CS Fundamentals Trainer · JavaScript · Security
Which practices reduce supply-chain risk for a JavaScript project?
- Changing exact versions like `"4.17.21"` to ranges like `"^4.17.21"`
- Committing `package-lock.json` and installing with `npm ci` in CI
- Installing with `--ignore-scripts` and allowing lifecycle scripts only for packages that need them
- Running `npm audit`, which flags newly published malicious packages before any advisory exists
- Preferring packages with npm provenance and verifying with `npm audit signatures`
Difficulty: hard