Files
tldr/pages/common/npm-audit.md
Bharatesh 2e0193b989 npm audit: add page (#14499)
Co-authored-by: Wiktor Perskawiec <git@spageektti.cc>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-10-31 17:46:49 +01:00

34 lines
858 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# npm audit
> Scan for known vulnerabilities in project dependencies.
> Reports vulnerabilities and suggests remediation.
> More information: <https://docs.npmjs.com/cli/npm-audit>.
- Scan the projects dependencies for known vulnerabilities:
`npm audit`
- Automatically fix vulnerabilities in the project's dependencies:
`npm audit fix`
- Force an automatic fix to dependencies with vulnerabilities:
`npm audit fix {{-f|--force}}`
- Update the lock file without modifying the `node_modules` directory:
`npm audit fix --package-lock-only`
- Perform a dry run. Simulate the fix process without making any changes:
`npm audit fix --dry-run`
- Output audit results in JSON format:
`npm audit --json`
- Configure the audit to only fail on vulnerabilities above a specified severity:
`npm audit --audit-level={{info|low|moderate|high|critical}}`