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

Function getAuditReport

deps/npm/lib/utils/reify-output.js:150–174  ·  view source on GitHub ↗
(npm, report)

Source from the content-addressed store, hash-verified

148}
149
150const getAuditReport = (npm, report) => {
151 if (!report) {
152 return
153 }
154
155 // when in silent mode, we print nothing.
156 // the JSON output is going to just JSON.stringify() the report object.
157 const reporter = npm.silent ? 'quiet'
158 : npm.flatOptions.json ? 'quiet'
159 : npm.command !== 'audit' ? 'install'
160 : 'detail'
161 const defaultAuditLevel = npm.command !== 'audit' ? 'none' : 'low'
162 const auditLevel = npm.flatOptions.auditLevel || defaultAuditLevel
163
164 const res = npmAuditReport(report, {
165 reporter,
166 ...npm.flatOptions,
167 auditLevel,
168 chalk: npm.chalk,
169 })
170 if (npm.command === 'audit') {
171 process.exitCode = process.exitCode || res.exitCode
172 }
173 return res
174}
175
176const packagesChangedMessage = (npm, { added, removed, changed, audited }) => {
177 const msg = ['\n']

Callers 2

reifyOutputFunction · 0.85
printAuditReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…