From 433020ead5251b562bc3b0f5f55341a5b8cc9023 Mon Sep 17 00:00:00 2001 From: "Emilis Dambauskas (Tokenmill)" Date: Wed, 9 Jan 2019 11:59:47 +0200 Subject: [PATCH] docs: described exit codes in npm-audit docs PR-URL: https://github.com/npm/cli/pull/135 Credit: @emilis-tm Reviewed-By: @zkat --- doc/cli/npm-audit.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/cli/npm-audit.md b/doc/cli/npm-audit.md index 4c6d717418ab3..f63bbd356d5a0 100644 --- a/doc/cli/npm-audit.md +++ b/doc/cli/npm-audit.md @@ -65,7 +65,8 @@ $ npm audit --parseable | awk -F $'\t' '{print $1,$4}' The audit command submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities. The report returned includes instructions on how to act on -this information. +this information. The command will exit with a 0 exit code if no +vulnerabilities were found. You can also have npm automatically fix the vulnerabilities by running `npm audit fix`. Note that some vulnerabilities cannot be fixed automatically and @@ -99,6 +100,13 @@ The non-reversible identifiers are a sha256 of a session-specific UUID and the value being replaced, ensuring a consistent value within the payload that is different between runs. +## EXIT CODE + +The `npm audit` command will exit with a 0 exit code if no vulnerabilities were found. + +If vulnerabilities were found the exit code will depend on the `audit-level` +configuration setting. + ## SEE ALSO * npm-install(1)