Skip to content

Commit 433020e

Browse files
emilis-tmzkat
authored andcommitted
docs: described exit codes in npm-audit docs
PR-URL: #135 Credit: @emilis-tm Reviewed-By: @zkat
1 parent a805a95 commit 433020e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doc/cli/npm-audit.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ $ npm audit --parseable | awk -F $'\t' '{print $1,$4}'
6565
The audit command submits a description of the dependencies configured in
6666
your project to your default registry and asks for a report of known
6767
vulnerabilities. The report returned includes instructions on how to act on
68-
this information.
68+
this information. The command will exit with a 0 exit code if no
69+
vulnerabilities were found.
6970

7071
You can also have npm automatically fix the vulnerabilities by running `npm
7172
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
99100
value being replaced, ensuring a consistent value within the payload that is
100101
different between runs.
101102

103+
## EXIT CODE
104+
105+
The `npm audit` command will exit with a 0 exit code if no vulnerabilities were found.
106+
107+
If vulnerabilities were found the exit code will depend on the `audit-level`
108+
configuration setting.
109+
102110
## SEE ALSO
103111

104112
* npm-install(1)

0 commit comments

Comments
 (0)