npm Scripts

View saved

Add scripts

Store common commands in package.json so teammates run the same steps.

{
  "scripts": {
    "build": "tsc",
    "watch": "tsc --watch",
    "start": "node dist/app.js"
  }
}

Run them

Use npm to invoke the named scripts.

npm run build
npm run watch
npm start

Local TypeScript binary

Project installs expose tsc via npm scripts or npx tsc without a global install.

npx tsc --version

Workflow tips

  • Commit package.json and package-lock.json
  • Put sources in src/ and emit to dist/
  • Add a clean script that removes dist when builds get messy
  • Keep learning scripts small before adding bundlers

Comments

One comment per signed-in account. Comments are saved with this page’s URL.