code: function getModulesByDir (dir, scope = '') {
    const nodeModulesDir = getNodeModulesDir()
    const results = []
    const modules = fs.readdirSync(dir)
  
    if (!modules.length) {
      return results
    }
  
    modules.forEach(module => {
      if (module.startsWith('.')) {
  
      } else if (module.startsWith('@')) {
        const subDir = path.join(nodeModulesDir, module)
        const subModules = getModulesByDir(subDir, module)
        Array.prototype.push.call(results, ...subModules)
      } else {
        results.push(scope ? `${scope}/${module}` : module)
      }
    })
  
    return results
  }
docs: 获取全部目录下的模块
  
  @param {string} dir 目录
  @param {string} [scope] scope
  @returns {Array<string>} modules