2024-03-03 10:45:44 +01:00
|
|
|
# pnpm audit
|
|
|
|
|
|
|
|
> Scan project dependencies.
|
|
|
|
> Check for known security issues with the installed packages.
|
|
|
|
> More information: <https://pnpm.io/cli/audit>.
|
|
|
|
|
|
|
|
- Identify vulnerabilities in the project:
|
|
|
|
|
|
|
|
`pnpm audit`
|
|
|
|
|
|
|
|
- Automatically fix vulnerabilities:
|
|
|
|
|
|
|
|
`pnpm audit fix`
|
|
|
|
|
|
|
|
- Generate a security report in JSON format:
|
|
|
|
|
|
|
|
`pnpm audit --json > {{path/to/audit-report.json}}`
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
- Audit only dev dependencies:
|
2024-03-03 10:45:44 +01:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`pnpm audit {{[-D|--dev]}}`
|
2024-03-03 10:45:44 +01:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
- Audit only production dependencies:
|
2024-03-03 10:45:44 +01:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`pnpm audit {{[-P|--prod]}}`
|
2024-03-03 10:45:44 +01:00
|
|
|
|
|
|
|
- Exclude optional dependencies from the audit:
|
|
|
|
|
|
|
|
`pnpm audit --no-optional`
|
|
|
|
|
|
|
|
- Ignore registry errors during the audit process:
|
|
|
|
|
|
|
|
`pnpm audit --ignore-registry-errors`
|
|
|
|
|
|
|
|
- Filter advisories by severity (low, moderate, high, critical):
|
|
|
|
|
|
|
|
`pnpm audit --audit-level {{severity}}`
|