MCPcopy Index your code
hub / github.com/nodejs/node / printNode

Function printNode

deps/npm/lib/utils/explain-dep.js:20–35  ·  view source on GitHub ↗
(node, chalk)

Source from the content-addressed store, hash-verified

18}
19
20const printNode = (node, chalk) => {
21 const extra = []
22
23 for (const meta of ['extraneous', 'dev', 'optional', 'peer', 'bundled', 'overridden']) {
24 if (node[meta]) {
25 extra.push(` ${colorType(meta, chalk)}`)
26 }
27 }
28
29 const pkgid = node.isWorkspace
30 ? chalk.blueBright(`${node.name}@${node.version}`)
31 : `${node.name}@${node.version}`
32
33 return `${pkgid}${extra.join('')}` +
34 (node.location ? chalk.dim(`\n${node.location}`) : '')
35}
36
37const explainLinksIn = ({ linksIn }, depth, chalk, seen) => {
38 if (!linksIn || !linksIn.length || depth <= 0) {

Callers 4

explainNodeFunction · 0.70
explainFromFunction · 0.70
explainFunction · 0.70
explain-dep.jsFile · 0.50

Calls 3

colorTypeFunction · 0.85
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected