Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/audit-error.js')
-rw-r--r--lib/utils/audit-error.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/utils/audit-error.js b/lib/utils/audit-error.js
index ae0749ff6..c58c1d16e 100644
--- a/lib/utils/audit-error.js
+++ b/lib/utils/audit-error.js
@@ -3,7 +3,6 @@
// prints a JSON version of the error if it's --json
// returns 'true' if there was an error, false otherwise
-const output = require('./output.js')
const auditError = (npm, report) => {
if (!report || !report.error)
return false
@@ -18,7 +17,7 @@ const auditError = (npm, report) => {
const { body: errBody } = error
const body = Buffer.isBuffer(errBody) ? errBody.toString() : errBody
if (npm.flatOptions.json) {
- output(JSON.stringify({
+ npm.output(JSON.stringify({
message: error.message,
method: error.method,
uri: error.uri,
@@ -27,7 +26,7 @@ const auditError = (npm, report) => {
body,
}, null, 2))
} else
- output(body)
+ npm.output(body)
throw 'audit endpoint returned an error'
}