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

Function cmdNames

deps/npm/lib/utils/npm-usage.js:41–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41const cmdNames = () => {
42 const out = ['']
43
44 const line = !process.stdout.columns ? COL_MAX
45 : Math.min(COL_MAX, Math.max(process.stdout.columns - COL_GUTTER, COL_MIN))
46
47 let l = 0
48 for (const c of commands) {
49 if (out[l].length + c.length + 2 < line) {
50 out[l] += ', ' + c
51 } else {
52 out[l++] += ','
53 out[l] = c
54 }
55 }
56
57 return indentNewline() + out.join(indentNewline()).slice(2)
58}
59
60const cmdUsages = (Npm) => {
61 // return a string of <command>: <usage>

Callers 1

npm-usage.jsFile · 0.85

Calls 5

indentNewlineFunction · 0.85
sliceMethod · 0.65
minMethod · 0.45
maxMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…