npm scripts Explained

What npm scripts does, with an example.

Published November 12, 2026

npm scripts let you define custom, named commands in package.json that can be run with npm run <name>.

Key points

  • Part of the standard npm CLI that ships with Node.js

Example

"scripts": {
  "start": "node index.js",
  "test": "jest"
}
More JavaScript articles