PHP 8.2.30
Preview: installed-shallow.js Size: 543 B
//proc/self/root/opt/alt/alt-nodejs16/root/lib/node_modules/npm/lib/utils/completion/installed-shallow.js

const { promisify } = require('util')
const readdir = promisify(require('readdir-scoped-modules'))

const installedShallow = async (npm, opts) => {
  const names = global => readdir(global ? npm.globalDir : npm.localDir)
  const { conf: { argv: { remain } } } = opts
  if (remain.length > 3) {
    return null
  }

  const { global } = npm.flatOptions
  const locals = global ? [] : await names(false)
  const globals = (await names(true)).map(n => global ? n : `${n} -g`)
  return [...locals, ...globals]
}

module.exports = installedShallow

Directory Contents

Dirs: 0 × Files: 2

Name Size Perms Modified Actions
1.10 KB lrw-r--r-- 2026-03-17 06:55:03
Edit Download
543 B lrw-r--r-- 2026-03-17 06:55:03
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).