Share an npm audit report
npm audit is one of the few security tools every JavaScript team already
runs, and one of the least acted upon. The output is terminal text, it scrolls
past in CI, and its recommendation is frequently npm audit fix --force,
which nobody is going to run on a Friday. So the audit becomes noise that the
build prints and the team filters out.
The fix is not a different scanner. It is putting the results somewhere a human decision can attach to them.
Have an audit.json already? Drop it into the free
npm audit viewer — it turns npm, pnpm or yarn audit
JSON into a report with each advisory, its CVSS score, the packages it reaches
and the fix, in your browser, and copies a Markdown table for the PR.
Publish it
npm audit --json > audit.json || true
npx npm-audit-html --input audit.json --output audit.html
curl -fsS -X PATCH \
"https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
-H "Authorization: Bearer $COMMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html audit.html \
--arg title "npm audit — web — $(date +%F)" \
'{title: $title, html: $html}')"
|| true because a non-zero exit means findings, which is the case you care
about. PATCH keeps one URL per workspace with a revision per run.