index.js
function getFolders(dir) {
  try {
    return fs.readdirSync(dir)
      .filter(function (file) {
        return exports.isDirectory(path.join(dir, file));
      });
  } catch (ex) {
    return [];
  }
}
function getFolders(dir) {
  try {
    return fs.readdirSync(dir)
      .filter(function (file) {
        return exports.isDirectory(path.join(dir, file));
      });
  } catch (ex) {
    return [];
  }
}
function getFolders ( dir ) { try { return fs . readdirSync ( dir ) . filter ( function ( file ) { return exports . isDirectory ( path . join ( dir , file ) ) ; } ) ; } catch ( ex ) { return [ ] ; } }
Get folder names.

Should only occur once per directory.

@param  {string} dir enclosing folder
@return {[]}     array of folder names
Get folder names .