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

Method runPending

deps/npm/lib/utils/allow-scripts-cmd.js:105–134  ·  view source on GitHub ↗
(unreviewed)

Source from the content-addressed store, hash-verified

103 }
104
105 runPending (unreviewed) {
106 if (this.npm.flatOptions.json) {
107 output.buffer({ allowScripts: this.pendingSummary(unreviewed) })
108 return
109 }
110 if (unreviewed.length === 0) {
111 output.standard('No packages with unreviewed install scripts.')
112 return
113 }
114 const count = unreviewed.length
115 const has = count === 1 ? 'has' : 'have'
116 const pkg = count === 1 ? 'package' : 'packages'
117 output.standard(
118 `${count} ${pkg} ${has} install scripts not yet covered by allowScripts:`
119 )
120 for (const { node, scripts } of unreviewed) {
121 const { name, version } = trustedDisplay(node)
122 /* istanbul ignore next: every test node has a name */
123 const display = name || '<unknown>'
124 const ver = version ? `@${version}` : ''
125 const events = Object.entries(scripts)
126 .map(([event, cmd]) => `${event}: ${cmd}`)
127 .join('; ')
128 output.standard(` ${display}${ver} (${events})`)
129 }
130 output.standard('')
131 output.standard(
132 'Run `npm approve-scripts <pkg>` to allow, or `npm deny-scripts <pkg>` to deny.'
133 )
134 }
135
136 // Build the same `{ name, changes }` shape printSummary uses for writes,
137 // but tag every entry as `pending` since nothing is written. Names and

Callers 1

execMethod · 0.95

Calls 5

pendingSummaryMethod · 0.95
mapMethod · 0.65
bufferMethod · 0.45
joinMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected