Cut npm audit down to what matters — production, high-severity, fixable vulnerabilities only. Zero dependencies.
Project description
auditclean
npm audit cries wolf. auditclean tells you what to actually fix. A typical
audit report is ~80% noise — dev-only CVEs that never ship, transitive advisories
with no available fix, low-severity findings buried under two screens of red text.
auditclean keeps only what's actionable: production dependencies, at or above
a severity threshold, with a fix available. Zero dependencies.
pip install auditclean
auditclean
auditclean — 2 of 47 advisories need action (≥ high, production, fixable)
● critical lodash <=4.17.20 Prototype Pollution in lodash → npm audit fix
● high minimist <1.2.6 Prototype Pollution in minimist → upgrade minimist to 1.2.8
45 hidden (below high · dev-only · no fix). See everything: auditclean --all
Why
npm audit was famously called "broken by design":
it reports every advisory in your entire dependency tree, including ones in build
tooling that never reach production and ones with no fix you can apply. The result
is alert fatigue — a wall of output you learn to || true past in CI, which is
exactly how a real critical slips through.
The existing alternatives want a config file (audit-filter), interactive prompts
(npm-audit-resolver), or an account (a SaaS scanner). auditclean wants nothing:
run it, get the short list.
How it works
By default it runs npm audit --omit=dev --json for you (so you only see
production vulnerabilities), then filters to high+ severity with a fix:
auditclean # run audit, show prod high+ fixable
auditclean --level critical # only critical
auditclean --all # show everything (low+, dev, unfixable), just cleaned up
You can also feed it a report you already have:
npm audit --json | auditclean
npm audit --omit=dev --json | auditclean # prod-only on piped input
It understands both npm audit JSON schemas — v2 (npm 7+, vulnerabilities)
and v1 (npm 6, advisories) — and normalizes the fix advice, including
isSemVerMajor upgrades flagged as (breaking).
In CI
auditclean exits non-zero only when something actionable is left after
filtering, so it gates on signal instead of noise:
# fails the build only on production, high+, fixable vulnerabilities
- run: npx auditclean
| Exit code | Meaning |
|---|---|
0 |
nothing actionable at the threshold |
1 |
actionable vulnerabilities found |
2 |
error (npm missing, unparseable input) |
Options
--level <sev> minimum severity: low | moderate | high | critical (default: high)
--include-unfixable also show vulns with no fix available
--include-dev also include devDependencies (when reading piped full JSON)
--all shorthand for --level low --include-unfixable --include-dev
--format text|json output format (default: text)
-v, --version
-h, --help
--format json emits { format, level, total, actionable, hidden, counts, vulnerabilities }
for programmatic use.
Notes
- Production filtering comes from running
npm audit --omit=dev. If you pipe a fullnpm audit --json, the npm 7+ schema doesn't tag dev per-vuln — pipenpm audit --omit=dev --jsonto get the same result on stdin. - Zero dependencies. It shells out to your
npmand parses JSON with the standard library. Nothing to install, nothing to audit.
Also available for Node
npx auditclean
Same filtering, same flags, same exit codes — auditclean on npm.
Note: this Python package shells out to your installed
npmto read the audit report, so Node/npm must be on PATH. It's handy in Python-based CI that audits a Node sub-project.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file auditclean-0.1.0.tar.gz.
File metadata
- Download URL: auditclean-0.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be9cb9e66ebaf475e5340c6a5413eff49e9572a5aab0b31b72b2069aa10e99b3
|
|
| MD5 |
b7a604d64efceab7e1ebc0998561c909
|
|
| BLAKE2b-256 |
044dd43808d21df821695793eca211480ff31d90328a03df3847cd123ef99a25
|
File details
Details for the file auditclean-0.1.0-py3-none-any.whl.
File metadata
- Download URL: auditclean-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9bd35994cf19a408408c03642b9d9404f68d2d39d0ce998fa2c514460ba45df
|
|
| MD5 |
ca5ae3bf291eb11b4580f17f37c14e7b
|
|
| BLAKE2b-256 |
00eb538f79ff73fcf7d27e1eef332b2de564e6833e5c62a366489108908c8e84
|