nodemon: Automatic Restart for Node.js Development Servers
Monitor for any changes in your node.js application and automatically restart the server - perfect for development
At a glance
- What is it?
- nodemon is a development wrapper for Node.js that watches the file system and restarts the process automatically when files change, replacing the manual stop-and-start cycle during development. It requires no changes to application code and supports non-Node runtimes through a configurable executor map.
- Who is it for?
- nodemon fits any Node.js development workflow where manual restarts slow iteration. Global installation makes it available across all projects instantly.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 18 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 28, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What nodemon Does and Why It Exists
nodemon is a tool designed for Node.js development that monitors the working directory for file changes and automatically restarts the Node process when a change is detected. The README describes it as a replacement wrapper for node: the developer replaces the word node on the command line with nodemon, and the behavior is otherwise identical.
The problem it solves is the manual restart loop. Without it, every change to server code requires stopping the running process with Ctrl+C and relaunching. nodemon removes that step entirely. The README notes that it does not require any changes to application code or development method.
The tool also handles clean-exit scripts, not just hanging servers. If the script exits on its own, nodemon continues monitoring the directory and restarts the script again when a change is detected. This makes it useful for scripts, data processors, and anything else run with node, not only Express or HTTP servers.
Installing nodemon Globally or as a Dev Dependency
The README documents two installation paths. The first installs nodemon globally, making it available across all projects as a command in the system path:
npm install -g nodemon # or using yarn: yarn global add nodemonThe second installs it as a development dependency of a specific project:
npm install --save-dev nodemon # or using yarn: yarn add nodemon -DWith a local installation, nodemon is not in the system path and cannot be called directly from the terminal. The README says to run it through an npm script (such as npm start) or via npx nodemon. The dev dependency approach is better suited to projects where the exact nodemon version matters for CI consistency.
Basic Usage: Starting a Server and Passing Arguments
Replacing node with nodemon in any command starts the watcher. The general syntax is:
nodemon [your node app]For help with all available flags:
nodemon -hA server that previously took a host and port as arguments can be started with:
nodemon ./server.js localhost 8080All output from the application is passed through unchanged, prefixed with [nodemon] for nodemon's own messages. The Node.js --inspect flag for the debugger can be passed the same way:
nodemon --inspect ./server.js 80If the project has a package.json with a main property, nodemon reads that value and uses it as the entry point without an explicit file argument. It also searches for a scripts.start property in package.json as of version 1.1.x.
While nodemon is running, typing rs and pressing Enter restarts the process manually without stopping the watcher. This is the recommended path for manual restarts rather than killing and relaunching nodemon.
Configuration Files and the nodemonConfig Key
nodemon supports local and global configuration files, typically named nodemon.json, placed in the current working directory or the home directory. A specific config file can be pointed to with --config <file>. The priority order is command-line arguments, then local config, then global config.
The README shows a nodemon.json example that covers several common settings:
{
"verbose": true,
"ignore": ["*.test.js", "**/fixtures/**"],
"execMap": {
"rb": "ruby",
"pde": "processing --sketch={{pwd}} --run"
}
}The execMap key maps file extensions to executors. This specific example adds support for Ruby files and Processing files. nodemon will detect the file extension of the running script and use the mapped executor automatically.
Configuration can also live inside package.json under the nodemonConfig key:
{
"name": "nodemon",
"nodemonConfig": {
"ignore": ["**/test/**", "**/docs/**"],
"delay": 2500
}
}The README notes that if a --config file or a local nodemon.json exists, the package.json configuration is ignored entirely. The two approaches do not merge.
Running Non-Node Scripts and Monitoring Multiple Directories
nodemon is not limited to Node.js files. The --exec flag specifies an arbitrary executor:
nodemon --exec "python -v" ./app.pyWith this command, nodemon runs app.py using Python with the -v flag and watches for changes to .py files. The README states that nodemon reads the file extension of the running script and monitors that extension when no nodemon.json is present.
For non-standard extensions, the global nodemon.json is the recommended place to add execMap entries. The README gives Perl as an example:
{
"execMap": {
"pl": "perl"
}
}To watch multiple directories, the --watch flag accepts repeated entries:
nodemon --watch app --watch libs app/server.jsThis example restricts nodemon to watching ./app and ./libs only, ignoring all other directories. Subdirectories are traversed automatically, so there is no need to list them. Unix globbing patterns are also supported with the --watch flag, though the README notes that the pattern must be quoted and references the picomatch documentation for advanced glob patterns.
What nodemon Does Not Handle Well
nodemon is a development-only tool and is not suited for production. The package.json shows engines set to node >= 10, but the most recent release is from 2026-02-20 at version 3.1.14. The last repository push was on 2026-09-12.
The tool has no built-in debounce intelligence for distinguishing intentional edits from automated writes: saving a generated file repeatedly can cause rapid restart cycles. The delay option in the config file addresses this by adding a wait before restarting.
The README references doc/requireable.md for using nodemon as a module and doc/events.md for child process integration. Developers needing programmatic control over the restart lifecycle must consult those documents separately.
For TypeScript projects, nodemon does not compile TypeScript itself. The README mentions TypeScript in the RELATED SEARCHES list but does not provide a documented execMap configuration for ts-node. The README's FAQ and issues list at GitHub are referenced for further guidance.
Alternatives: ts-node-dev and Vite HMR
ts-node-dev is a development watcher built specifically for TypeScript that combines file watching with ts-node's in-process TypeScript compilation, so no separate build step is needed between saves and restarts. nodemon with ts-node installed handles TypeScript through execMap but requires separate configuration.
Vite is a build tool and development server for browser-based applications that uses hot module replacement to apply code changes without a full process restart. Vite operates in the browser layer and cannot replace nodemon for server-side Node.js processes. The two are complementary: Vite for the frontend, nodemon (or ts-node-dev) for the backend.
For pure Node.js servers in production that must survive crashes and restart cleanly, PM2 is a process manager designed for that purpose, with clustering, log management, and health monitoring. nodemon is explicitly a development tool and the README makes no claims about production use.
Editorial conclusion
nodemon fits any Node.js development workflow where manual restarts slow iteration. Global installation makes it available across all projects instantly. For teams that want the restart behavior locked to a specific project version, the dev dependency path with npx nodemon is more reproducible. Before using it in a TypeScript project, confirm that ts-node or a compatible executor is configured in the execMap or via the --exec flag, since the README does not show that configuration directly.
Frequently asked questions
What is nodemon used for?
nodemon is used during Node.js development to watch the file system and automatically restart the Node process when files change, eliminating the need to manually stop and restart the server after every code edit.
How do I install nodemon?
Install nodemon globally with npm install -g nodemon to use it across all projects, or as a dev dependency with npm install --save-dev nodemon for project-specific use via npm scripts or npx nodemon.
How do I start a server using nodemon?
Replace the node command with nodemon when running your entry file, for example nodemon ./server.js. nodemon passes all arguments through to the application and restarts the process automatically when files change.
How do I use nodemon in a package.json script?
Set the start script in package.json to nodemon ./server.js and run npm start. Alternatively, add nodemon configuration under a nodemonConfig key in the same package.json to set ignored paths and delay.
Is nodemon still used?
Yes. The most recent release is version 3.1.14, published on 2026-02-20, and the last push to the repository was on 2026-09-12. The package remains a standard part of many Node.js development workflows.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/remy-nodemon)