(npm, report)
| 148 | } |
| 149 | |
| 150 | const 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 | |
| 176 | const packagesChangedMessage = (npm, { added, removed, changed, audited }) => { |
| 177 | const msg = ['\n'] |
no outgoing calls
no test coverage detected
searching dependent graphs…