nodemon
Nodemon is a utility that monitors for file changes in your Node.js application and automatically restarts the server when modifications are detected. It elimin…
Installation
npm install -D nodemon
yarn add -D nodemon
pnpm add -D nodemon
Import
// Used as CLI: nodemon server.js
Quick Example
// nodemon.json
{
"watch": ["src"],
"ext": "ts,json",
"ignore": ["dist", "*.test.ts"],
"exec": "tsx src/server.ts"
}
// Or: npx nodemon --watch src server.jsAbout nodemon
Nodemon is a utility that monitors for file changes in your Node.js application and automatically restarts the server when modifications are detected. It eliminates the tedious cycle of manually stopping and starting your development server every time you make a code change. Nodemon watches the files in the directory where it was started and restarts the process when any file with a monitored extension changes. The tool is configured through a nodemon.json file or command-line arguments, supporting custom watch directories, ignore patterns (like node_modules, test files, or build directories), file extension filters, delay before restarting, environment variable injection, and custom execution commands. Nodemon works with any Node.js application — it wraps the node command transparently, so replacing node server.js with nodemon server.js enables automatic restarts with no code changes. The tool supports graceful shutdown by sending configurable signals (SIGUSR2 by default) to the process before restart. Nodemon can also execute non-Node scripts by specifying a custom exec command, making it useful for watching and restarting any command-line process. While modern tools like tsx and Vite include built-in watch modes, nodemon remains the most widely used file watcher for Node.js development.
Quick Facts
| Package | nodemon |
| Category | Utility |
| Weekly Downloads | 5M+ |
| License | MIT |
| Install | npm install -D nodemon |
Related Packages
PM2 is a production process manager for Node.js applications that provides process monitoring, autom…
tsx is a TypeScript execute tool that lets you run TypeScript files directly in Node.js without a co…
ts-node is a TypeScript execution engine and REPL for Node.js that transforms TypeScript to JavaScri…
Concurrently is a utility for running multiple commands simultaneously in a single terminal, with ea…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.