lib/freeze.js
function mkpath(path) {
    var dirs = path.split(PATH.sep);
    var _path = '';
    var winDisk = /^\w{1}:\\$/;

    dirs.forEach(function(dir) {
        dir = dir || PATH.sep;
        if (dir) {
            _path = _path ? PATH.join(_path, dir) : dir;
            // fs.mkdirSync('/') raises EISDIR (invalid operation) exception on OSX 10.8.4/node 0.10
            // fs.mkdirSync('D:\\') raises EPERM (operation not permitted) exception on Windows 7/node 0.10
            // not tested in other configurations
            if (_path === '/' || winDisk.test(PATH.resolve(dir))) {
                return;
            }
            // @see https://github.com/veged/borschik/issues/90
            try {
                fs.mkdirSync(_path);
            } catch(e) {
                // ignore EEXIST error
                if (e.code !== 'EEXIST') {
                    throw new Error(e)
                }
            }
        }
    });
}
function mkpath(path) {
    var dirs = path.split(PATH.sep);
    var _path = '';
    var winDisk = /^\w{1}:\\$/;

    dirs.forEach(function(dir) {
        dir = dir || PATH.sep;
        if (dir) {
            _path = _path ? PATH.join(_path, dir) : dir;
            // fs.mkdirSync('/') raises EISDIR (invalid operation) exception on OSX 10.8.4/node 0.10
            // fs.mkdirSync('D:\\') raises EPERM (operation not permitted) exception on Windows 7/node 0.10
            // not tested in other configurations
            if (_path === '/' || winDisk.test(PATH.resolve(dir))) {
                return;
            }
            // @see https://github.com/veged/borschik/issues/90
            try {
                fs.mkdirSync(_path);
            } catch(e) {
                // ignore EEXIST error
                if (e.code !== 'EEXIST') {
                    throw new Error(e)
                }
            }
        }
    });
}
function mkpath ( path ) { var dirs = path . split ( PATH . sep ) ; var _path = '' ; var winDisk = / ^\w{1}:\\$ / ; dirs . forEach ( function ( dir ) { dir = dir || PATH . sep ; if ( dir ) { _path = _path ? PATH . join ( _path , dir ) : dir ; // fs.mkdirSync('/') raises EISDIR (invalid operation) exception on OSX 10.8.4/node 0.10 // fs.mkdirSync('D:\\') raises EPERM (operation not permitted) exception on Windows 7/node 0.10 // not tested in other configurations if ( _path === '/' || winDisk . test ( PATH . resolve ( dir ) ) ) { return ; } // @see https://github.com/veged/borschik/issues/90 try { fs . mkdirSync ( _path ) ; } catch ( e ) { // ignore EEXIST error if ( e . code !== 'EEXIST' ) { throw new Error ( e ) } } } } ) ; }
Make dirs if not exists.

@param {String} path Path to make.
Make dirs if not exists .