Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm audit: add page #14499

Merged
merged 7 commits into from
Oct 31, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pages/common/npm-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# npm audit

> Scan for known vulnerabilities in project dependencies.
> Reports vulnerabilities and suggests remediation.
> More information: <https://docs.npmjs.com/cli/npm-audit>.

- Check your project for vulnerabilities- Scans your project’s dependencies for known vulnerabilities:

`npm audit`

- Automatically fix vulnerabilities- Attempts to fix vulnerabilities by updating to safe package versions:

`npm audit fix`

bharateshwq marked this conversation as resolved.
Show resolved Hide resolved
- Update only the `package-lock.json`- Updates the lock file without modifying the `node_modules` directory:

`npm audit fix --package-lock-only`

- Perform a dry run- Simulates the fix process without making any changes:

`npm audit fix --dry-run`

- Output audit results in JSON format- Provides audit results in a structured JSON format for processing:

`npm audit --json`

- Set a minimum severity level- Configures the audit to only fail on vulnerabilities above a specified severity:
bharateshwq marked this conversation as resolved.
Show resolved Hide resolved

`npm audit --audit-level={{info|low|moderate|high|critical}}`
Loading