pkg-audit-fix
v0.2.1
Published
Audit dependencies and run native fix flows across pnpm, npm, yarn, and bun.
Maintainers
Readme
pkg-audit-fix

One command to audit dependencies and run the native fix flow for pnpm, npm, yarn, and bun.
It detects your package manager, applies the best available remediation flow, then summarizes what changed and what still needs attention.
Requirements
- Node.js
>=20.19
Usage
Run in your project:
npx pkg-audit-fix@latestOr install globally:
npm install --global pkg-audit-fix
pkg-audit-fixExamples
pkg-audit-fix
pkg-audit-fix --cwd ./app
pkg-audit-fix --prod
pkg-audit-fix --dev --audit-level high
pkg-audit-fix --dry-run
pkg-audit-fix --jsonOptions
--manager <auto|pnpm|npm|yarn|bun>: override detection--prod: audit production dependencies only--dev: audit development dependencies only--audit-level <low|moderate|high|critical>: set the minimum severity--dedupe <auto|always|never>: run dedupe when supported--dry-run: audit without applying fixes--json: output a machine-readable summary--show-commands: print package-manager commands--verbose: stream command output
Package Managers
pnpm: audit, fix, reinstall, andminimumReleaseAgehandlingnpm: audit andnpm audit fixyarnClassic: audit and reportyarnBerry: audit, recheck, and optional dedupebun: audit, manual remediation prompt, and re-audit
Programmatic API
import { formatTextSummary, runAuditFix } from "pkg-audit-fix";
const result = await runAuditFix({
cwd: process.cwd()
});
console.log(formatTextSummary(result));Use toJsonSummary(result) for machine-readable output.
