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
path: root/doc
diff options
context:
space:
mode:
authorNick Graef <nicholas.a.graef@gmail.com>2019-02-14 02:44:37 +0300
committerisaacs <i@izs.me>2019-06-30 06:23:54 +0300
commit747fdaf66d84cacc1ee9a30bc09687b905b48f72 (patch)
tree8b162b7072df1fd6a286c3921bf0142240203165 /doc
parent39d473adf38a31954d0922f5cc6451ffd59fa362 (diff)
doc: add --audit-level param
implementation added in #31
Diffstat (limited to 'doc')
-rw-r--r--doc/cli/npm-audit.md17
1 files changed, 15 insertions, 2 deletions
diff --git a/doc/cli/npm-audit.md b/doc/cli/npm-audit.md
index f63bbd356..d9cd72505 100644
--- a/doc/cli/npm-audit.md
+++ b/doc/cli/npm-audit.md
@@ -3,8 +3,10 @@ npm-audit(1) -- Run a security audit
## SYNOPSIS
- npm audit [--json|--parseable]
- npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]
+ npm audit [--json|--parseable|--audit-level=(low|moderate|high|critical)]
+ npm audit fix [--force|--package-lock-only|--dry-run]
+
+ common options: [--production] [--only=(dev|prod)]
## EXAMPLES
@@ -60,6 +62,11 @@ To parse columns, you can use for example `awk`, and just print some of them:
$ npm audit --parseable | awk -F $'\t' '{print $1,$4}'
```
+Fail an audit only if the results include a vulnerability with a level of moderate or higher:
+```
+$ npm audit --audit-level=moderate
+```
+
## DESCRIPTION
The audit command submits a description of the dependencies configured in
@@ -75,6 +82,12 @@ runs a full-fledged `npm install` under the hood, all configs that apply to the
installer will also apply to `npm install` -- so things like `npm audit fix
--package-lock-only` will work as expected.
+By default, the audit command will exit with a non-zero code if any vulnerability
+is found. It may be useful in CI environments to include the `--audit-level` parameter
+to specify the minimum vulnerability level that will cause the command to fail. This
+option does not filter the report output, it simply changes the command's failure
+threshold.
+
## CONTENT SUBMITTED
* npm_version