index.js
function rmdirSync(root) {

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

  var chunks = root.split(path.sep); // split in chunks
  var chunk = path.resolve(root); // build absolute path
  // remove "/" from head and tail
  if (chunks[0] === '') {
    chunks.shift();
  }
  if (chunks[chunks.length - 1] === '') {
    chunks.pop();
  }

  return rmdirSyncRecursive(chunk, chunks);
}
function rmdirSync(root) {

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

  var chunks = root.split(path.sep); // split in chunks
  var chunk = path.resolve(root); // build absolute path
  // remove "/" from head and tail
  if (chunks[0] === '') {
    chunks.shift();
  }
  if (chunks[chunks.length - 1] === '') {
    chunks.pop();
  }

  return rmdirSyncRecursive(chunk, chunks);
}
function rmdirSync ( root ) { if ( typeof root !== 'string' ) { throw new Error ( 'missing root' ) ; } var chunks = root . split ( path . sep ) ; // split in chunks var chunk = path . resolve ( root ) ; // build absolute path // remove "/" from head and tail if ( chunks [ 0 ] === '' ) { chunks . shift ( ) ; } if ( chunks [ chunks . length - 1 ] === '' ) { chunks . pop ( ) ; } return rmdirSyncRecursive ( chunk , chunks ) ; }
removeSync main. Check README.md

@exports rmdirSync
@function rmdirSync
@param {String} root - pathname
@return [{Object}]
removeSync main . Check README . md