/usr/local/lib/node_modules/npm/lib/utils
NameSizeModeActions
audit-error.js10780644editdlrm
auth.js32880644editdlrm
cmd-list.js29530644editdlrm
completion.fish15960644editdlrm
completion.sh18980755editdlrm
did-you-mean.js11430644editdlrm
display.js167600644editdlrm
error-message.js157750644editdlrm
explain-dep.js36480644editdlrm
explain-eresolve.js25820644editdlrm
format-bytes.js6240644editdlrm
format-search-stream.js49130644editdlrm
format.js21400644editdlrm
get-identity.js7970644editdlrm
get-workspaces.js17480644editdlrm
installed-deep.js11290644editdlrm
installed-shallow.js5830644editdlrm
is-windows.js1770644editdlrm
log-file.js78600644editdlrm
npm-usage.js20720644editdlrm
oidc.js73680644editdlrm
open-url.js25530644editdlrm
output-error.js7880644editdlrm
ping.js2650644editdlrm
queryable.js96110644editdlrm
read-user-info.js20950644editdlrm
reify-finish.js7530644editdlrm
reify-output.js64750644editdlrm
sbom-cyclonedx.js56560644editdlrm
sbom-spdx.js52880644editdlrm
tar.js35110644editdlrm
timers.js21200644editdlrm
update-workspaces.js9970644editdlrm
validate-lockfile.js10230644editdlrm
verify-signatures.js124990644editdlrm
Edit: /usr/local/lib/node_modules/npm/lib/utils/installed-deep.js (1129B)
const { resolve } = require('node:path') const localeCompare = require('@isaacs/string-locale-compare')('en') const installedDeep = async (npm) => { const Arborist = require('@npmcli/arborist') const { depth, global, prefix, workspacesEnabled, } = npm.flatOptions const getValues = (tree) => [...tree.inventory.values()] .filter(i => i.location !== '' && !i.isRoot) .map(i => { return i }) .filter(i => (i.depth - 1) <= depth) .sort((a, b) => (a.depth - b.depth) || localeCompare(a.name, b.name)) const res = new Set() const gArb = new Arborist({ global: true, path: resolve(npm.globalDir, '..'), workspacesEnabled, }) const gTree = await gArb.loadActual({ global: true }) for (const node of getValues(gTree)) { res.add(global ? node.name : [node.name, '-g']) } if (!global) { const arb = new Arborist({ global: false, path: prefix, workspacesEnabled }) const tree = await arb.loadActual() for (const node of getValues(tree)) { res.add(node.name) } } return [...res] } module.exports = installedDeep