NPM Audit parser for GitLab dependency scanning
npm install @elpete/gitlab-npm-audit-parser``
Usage: gitlab-npm-audit-parser [options]
Options:
-V, --version output the version number
-o, --out
-h, --help output usage information
`
Install this package.
``
npm install --save-dev @elpete/gitlab-npm-audit-parser
Add the following job to _.gitlab-ci.yml_
`yaml`
dependency scanning:
image: node:10-alpine
script:
- npm ci
- npm audit --json | npx gitlab-npm-audit-parser -o gl-dependency-scanning.json
artifacts:
reports:
dependency_scanning: gl-dependency-scanning.jsonnpm run-script
NOTE: If you use a to call npm audit You must add the option --silent to npm run or have .npmrc set the NPM loglevel to silent otherwise the shell output will conflict with the stdin piping to this parser and cause an error.
`sh`
$ npm test
$3
cat test/v2_report.json | ./parse.js -o report.json`