index.js
function mkdirSync(root, mode) {

  if (typeof root !== 'string') {
    throw new Error('missing root');
  }

  var chunks = root.split(path.sep); // split in chunks
  var chunk;
  if (path.isAbsolute(root) === true) { // build from absolute path
    chunk = chunks.shift(); // remove "/" or C:/
    if (!chunk) { // add "/"
      chunk = path.sep;
    }
  } else {
    chunk = path.resolve(); // build with relative path
  }

  return mkdirSyncRecursive(chunk, chunks, mode);
}
function mkdirSync(root, mode) {

  if (typeof root !== 'string') {
    throw new Error('missing root');
  }

  var chunks = root.split(path.sep); // split in chunks
  var chunk;
  if (path.isAbsolute(root) === true) { // build from absolute path
    chunk = chunks.shift(); // remove "/" or C:/
    if (!chunk) { // add "/"
      chunk = path.sep;
    }
  } else {
    chunk = path.resolve(); // build with relative path
  }

  return mkdirSyncRecursive(chunk, chunks, mode);
}
function mkdirSync ( root , mode ) { if ( typeof root !== 'string' ) { throw new Error ( 'missing root' ) ; } var chunks = root . split ( path . sep ) ; // split in chunks var chunk ; if ( path . isAbsolute ( root ) === true ) { // build from absolute path chunk = chunks . shift ( ) ; // remove "/" or C:/ if ( ! chunk ) { // add "/" chunk = path . sep ; } } else { chunk = path . resolve ( ) ; // build with relative path } return mkdirSyncRecursive ( chunk , chunks , mode ) ; }
makeSync main. Check README.md

@exports mkdirSync
@function mkdirSync
@param {String} root - pathname
@param {Number} mode - directories mode, see Node documentation
@return [{Object}]
makeSync main . Check README . md