lib/io.js
function subDirectoriesWithFile(base, filename) {
  var result = [];
  if (fs.existsSync(base) && fs.statSync(base).isDirectory()) {
    if (fs.existsSync(path.join(base, filename))) {
      result.push(base);
    }
    fs.readdirSync(base)
      .forEach(function (subdir) {
        result.push.apply(result, subDirectoriesWithFile(path.join(base, subdir), filename));
      });
  }
  return result;
}
function subDirectoriesWithFile(base, filename) {
  var result = [];
  if (fs.existsSync(base) && fs.statSync(base).isDirectory()) {
    if (fs.existsSync(path.join(base, filename))) {
      result.push(base);
    }
    fs.readdirSync(base)
      .forEach(function (subdir) {
        result.push.apply(result, subDirectoriesWithFile(path.join(base, subdir), filename));
      });
  }
  return result;
}
function subDirectoriesWithFile ( base , filename ) { var result = [ ] ; if ( fs . existsSync ( base ) && fs . statSync ( base ) . isDirectory ( ) ) { if ( fs . existsSync ( path . join ( base , filename ) ) ) { result . push ( base ) ; } fs . readdirSync ( base ) . forEach ( function ( subdir ) { result . push . apply ( result , subDirectoriesWithFile ( path . join ( base , subdir ) , filename ) ) ; } ) ; } return result ; }
Find all subdirectories of the base, recursively.
@param base The base directory to start in
@param filename A filename that needs to be found for the path to be added
@return all subdirectories of the base, split by path separator
Find all subdirectories of the base recursively .