code: function _getFirstDirectory(dir) {
    var files = glob.sync(dir + '/*');
  
    for (var i = files.length; i--; ) {
      var file = files[i];
      if (fs.statSync(file).isDirectory()) return file;
    }
  
    return false;
  }
docs: Get the first directory of a string.