nodemon (Node.js)
nodemon is a development tool that watches your project files and automatically restarts your Node.js app whenever you save a change. It removes the need to manually stop and restart the server during development.
Node.js
Normally, after editing server code you must kill the running process and start it again to see changes. nodemon automates this: run nodemon server.js instead of node server.js, and it monitors your files, restarting the app the instant you save, which tightens the development feedback loop.
You install it as a dev dependency (npm install --save-dev nodemon) and usually wire it into a script: "dev": "nodemon server.js", run with npm run dev. It watches JavaScript and JSON by default, ignores node_modules, and you can configure watched paths, extensions, and ignore rules in a nodemon.json file.
nodemon is strictly a development convenience — it is not for production. In production you run plain node under a process manager like PM2 or a container that handles restarts on crash, not on file change.
Syntax
nodemon server.jsExamples
JavaScript
// package.json
{
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js"
},
"devDependencies": { "nodemon": "^3.0.0" }
}
// run: npm run dev