lib/packages.js
async function fetchAllDependents (name) {
  let pkg = await npm.getLatest(name)
  let deps = Object.keys(pkg.dependencies || {})
  if (!deps.length) return []
  let promises = []
  for (let dep of deps) {
    promises.push(fetchAllDependents(dep))
  }
  for (let subdeps of await Promise.all(promises)) {
    deps = deps.concat(subdeps)
  }
  return _.uniq(deps.sort())
}
async function fetchAllDependents (name) {
  let pkg = await npm.getLatest(name)
  let deps = Object.keys(pkg.dependencies || {})
  if (!deps.length) return []
  let promises = []
  for (let dep of deps) {
    promises.push(fetchAllDependents(dep))
  }
  for (let subdeps of await Promise.all(promises)) {
    deps = deps.concat(subdeps)
  }
  return _.uniq(deps.sort())
}
async function fetchAllDependents ( name ) { let pkg = await npm . getLatest ( name ) let deps = Object . keys ( pkg . dependencies || { } ) if ( ! deps . length ) return [ ] let promises = [ ] for ( let dep of deps ) { promises . push ( fetchAllDependents ( dep ) ) } for ( let subdeps of await Promise . all ( promises ) ) { deps = deps . concat ( subdeps ) } return _ . uniq ( deps . sort ( ) ) }
traverses finding all dependents of a package
traverses finding all dependents of a package