View RSS feed

Local Node Dev with Nodemon

Published: Oct 15, 2024Source

When developing a node app locally, use nodemon to restart your dev server whenever changes are made to the files.

  1. Install the dev dependency.
npm install --save-dev nodemon
  1. Add a dev script to your package.json.
{
// ..
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
}
// ..
}
  1. Run dev server.
npm run dev