tools/npm/check-node-modules.js
function _deleteDir(path) {
  if (fs.existsSync(path)) {
    var subpaths = fs.readdirSync(path);
    subpaths.forEach(function(subpath) {
      var curPath = path + '/' + subpath;
      if (fs.lstatSync(curPath).isDirectory()) {
        _deleteDir(curPath);
      } else {
        fs.unlinkSync(curPath);
      }
    });
    fs.rmdirSync(path);
  }
}
function _deleteDir(path) {
  if (fs.existsSync(path)) {
    var subpaths = fs.readdirSync(path);
    subpaths.forEach(function(subpath) {
      var curPath = path + '/' + subpath;
      if (fs.lstatSync(curPath).isDirectory()) {
        _deleteDir(curPath);
      } else {
        fs.unlinkSync(curPath);
      }
    });
    fs.rmdirSync(path);
  }
}
function _deleteDir ( path ) { if ( fs . existsSync ( path ) ) { var subpaths = fs . readdirSync ( path ) ; subpaths . forEach ( function ( subpath ) { var curPath = path + '/' + subpath ; if ( fs . lstatSync ( curPath ) . isDirectory ( ) ) { _deleteDir ( curPath ) ; } else { fs . unlinkSync ( curPath ) ; } } ) ; fs . rmdirSync ( path ) ; } }
Custom implementation of recursive `rm` because we can't rely on the state of node_modules to
pull in existing module.
Custom implementation of recursive rm because we can t rely on the state of node_modules to pull in existing module .