npm scripts

noun

say it: “EN-PEE-EM SKRIPTS” /ˌɛn piː ˈɛm skrɪpts/

Short names for the commands a project uses, written in package.json and run with npm run and the name.

What does npm scripts do?

npm scripts are named commands in package.json, run with npm run <name> (or npm start, npm test).

npm run dev

In a sentence

  • “I added a lint entry to the npm scripts so anyone can check the code with npm run lint.”
  • “The project's npm scripts are dev, build and test, so I never have to remember the long commands behind them.”

Level: Novice · More Node.js terms at this level

Updated