mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
npm audit: add page (#14499)
Co-authored-by: Wiktor Perskawiec <git@spageektti.cc> Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:
parent
ea951f3ae9
commit
2e0193b989
1 changed files with 33 additions and 0 deletions
33
pages/common/npm-audit.md
Normal file
33
pages/common/npm-audit.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# 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 project’s 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}}`
|
Loading…
Add table
Reference in a new issue