npm audit — Security Scanning from CLI
Every production app must be scanned for known security vulnerabilities:
```cmd
npm audit
`
Sample output:
`
# npm audit report
lodash <4.17.21
Severity: high
Prototype Pollution - https://npmjs.com/advisories/1523
found 3 vulnerabilities (1 low, 1 moderate, 1 high)
`
Fix Workflow:
```cmd
npm audit # Scan for issues
npm audit fix # Auto-fix safe updates
npm audit # Re-scan to confirm fixed
`
Add to CI/CD Pipeline:
```cmd
npm audit --audit-level=high
if errorlevel 1 (echo HIGH severity vulnerabilities found! Block deploy. && exit /b 1)
`
Block deployments when high-severity vulnerabilities are found! 🛡️
