🛠️
Utility5M+/wkMIT

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
npm install -D nodemon
yarn
yarn add -D nodemon
pnpm
pnpm add -D nodemon

Import

ESM
// Used as CLI: nodemon server.js

Quick Example

usage
// nodemon.json
{
  "watch": ["src"],
  "ext": "ts,json",
  "ignore": ["dist", "*.test.ts"],
  "exec": "tsx src/server.ts"
}

// Or: npx nodemon --watch src server.js

About 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

Packagenodemon
CategoryUtility
Weekly Downloads5M+
LicenseMIT
Installnpm install -D nodemon

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.