Security Auditing in NPM
From the NPM Package Manager cheat sheet ยท Security & Maintenance ยท verified Jul 2026
Security Auditing
Find and fix security vulnerabilities
bash
# Run security audit
npm audit
# Show detailed report
npm audit --json
# Fix automatically
npm audit fix
# Force fixes (may break)
npm audit fix --force
# Audit production only
npm audit --omit=dev
# Set audit level
npm audit --audit-level=moderate๐ข Essential - Security is critical
๐ก Run audit regularly in CI/CD
โ ๏ธ --force may introduce breaking changes
๐ Set audit-level to fail CI appropriately
๐ Related: snyk, socket for advanced scanning
securityaudit