From 2e0193b989da4debae0a7b22e0d2231ad86240f3 Mon Sep 17 00:00:00 2001 From: Bharatesh <64769271+bharateshwq@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:16:49 +0530 Subject: [PATCH] npm audit: add page (#14499) Co-authored-by: Wiktor Perskawiec Co-authored-by: K.B.Dharun Krishna --- pages/common/npm-audit.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pages/common/npm-audit.md diff --git a/pages/common/npm-audit.md b/pages/common/npm-audit.md new file mode 100644 index 0000000000..032a5b3764 --- /dev/null +++ b/pages/common/npm-audit.md @@ -0,0 +1,33 @@ +# npm audit + +> Scan for known vulnerabilities in project dependencies. +> Reports vulnerabilities and suggests remediation. +> More information: . + +- 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}}`