Nodemon watches files in a Node.js project and restarts the application when changes are detected. It replaces the node command on the CLI so development workflows stay the same.
Overview
Nodemon wraps Node.js programs so developers can run scripts with automatic restarts whenever watched files change. It was built to keep web servers and similar long-running processes current during development without manual stop-and-start cycles.
You invoke it like node, passing the same arguments to your application. Output from the app appears as usual, with nodemon prefixing its own status lines. Manual restarts are available by typing rs while it is running. Configuration can live in nodemon.json, a global config file, or package.json under nodemonConfig, with CLI flags overriding file settings.
Beyond default Node monitoring, nodemon can run other executables such as Python or Ruby by mapping file extensions through execMap. You can limit watching to specific directories, set extension lists, ignore paths or patterns, add restart delays, and use legacy polling when file events are unreliable on mounted volumes.
The tool also supports graceful shutdown signals, running as a requireable module or child process, growl-style event hooks in config, and integration via community gulp and grunt plugins.
Key features
- Automatic restart on file changes
- Drop-in replacement for node on CLI
- Local and global config files
- Watch specific dirs and extensions
- Ignore files and glob patterns
- Run non-Node executables via execMap
- Manual restart with rs
- Configurable restart delay
Use cases
- Local Node.js API development
- Watching server apps during coding
- Running Python or Ruby scripts with reload
- Gulp or Grunt dev workflows
- REPL and one-shot utilities with watch