---
title: "npm audit"
description: "Runs `npm audit --json --package-lock-only` per lockfile (package-lock.json, npm-shrinkwrap.json). Runs on a temporary copy of the lockfile and package.json, so nothing is installed, no script runs and the project's .npmrc/bunfig/workspace config is never read. The registry is pinned to registry.npmjs.org; private registries are therefore not audited."
url: https://openaudit.se/auditors/code.npm-audit/
---

# npm audit

`code.npm-audit`

Runs `npm audit --json --package-lock-only` per lockfile (package-lock.json, npm-shrinkwrap.json). Runs on a temporary copy of the lockfile and package.json, so nothing is installed, no script runs and the project's .npmrc/bunfig/workspace config is never read. The registry is pinned to registry.npmjs.org; private registries are therefore not audited.

- **Engine:** Wrapped scanner
- **Wraps:** `npm`
- **Targets:** Codebase
- **Areas:** Supply chain, Security
- **Runs:** By default, when the target applies
- **Network:** Contacts services beyond the target

## Run only this auditor

```sh
bunx @openaudit/cli . --only code.npm-audit
```

Wraps npm. When it isn't installed, the auditor is skipped with an install hint and the rest of the audit runs.

## More supply chain auditors

- [Vulnerable dependencies](https://openaudit.se/auditors/code.dependencies/) (`code.dependencies`)
- [Dependency health](https://openaudit.se/auditors/code.dependency-health/) (`code.dependency-health`)
- [End-of-life runtimes and frameworks](https://openaudit.se/auditors/code.eol/) (`code.eol`)
- [Lockfile integrity and install scripts](https://openaudit.se/auditors/code.lockfiles/) (`code.lockfiles`)
- [osv-scanner dependency scan](https://openaudit.se/auditors/code.osv-scanner/) (`code.osv-scanner`)
- [govulncheck (Go vulnerabilities)](https://openaudit.se/auditors/code.govulncheck/) (`code.govulncheck`)
- [pip-audit (Python vulnerabilities)](https://openaudit.se/auditors/code.pip-audit/) (`code.pip-audit`)
- [cargo-audit (Rust advisories)](https://openaudit.se/auditors/code.cargo-audit/) (`code.cargo-audit`)
