npm, packages and scripts

package.json, semantic versioning, lockfiles, and the scripts and workspaces that keep a project reproducible.

package.json

{
  "name": "my-api",
  "version": "1.4.0",
  "type": "module",
  "scripts": {
    "start": "node src/server.js",
    "dev": "node --watch src/server.js",
    "test": "node --test"
  },
  "engines": { "node": ">=20" },
  "dependencies": { "express": "^4.19.0" },
  "devDependencies": { "eslint": "^9.0.0" }
}
CommandEffect
npm installInstall exactly what the lockfile pins
npm ciClean install for CI — faster and reproducible
npm outdatedShow available updates
npm auditReport known vulnerabilities
npm run