mrkeyoor.com_
Sun 20 Sept 17:52 UTC
npmCLI & Toolingupdated 20 Sept 2026

nodemon review

nodemon 3.1.14 is a development command that starts a child process, watches files, and replaces that process after a matching change. It commonly wraps `node src/server.js`, but `--exec` can run Python, Ruby, TypeScript loaders, or another executable. Watch paths, extensions, ignore globs, delay, restart signal, and event commands can live in nodemon.json, package.json, or CLI options. The current patch fixes file watching on Windows. Our Node 22 checks loaded the CommonJS package through both require() and ESM import, and the installed package included TypeScript declarations. It is a process and filesystem tool, not code for a browser bundle.

Verdict

nodemon 3.1.14 installed in 1.9 seconds and left 28 packages using 3 MB in our sandbox, with 0 audit findings and working CommonJS and ESM loads; it earns its devDependency when custom paths, commands, delays, or signals matter. Start with Node's built-in watch mode for plain JavaScript, or `tsx watch` when TypeScript execution is the actual requirement.

We installed it

Lab card: what happened when we installed nodemonScreenshot of nodemon documentation
Install✓ · 1.9s28 packages on disk · 3 MB
ImportESM import works · require() works · CommonJS package
Browsern/acould not be bundled for the browser (Node-only code, most likely)
TypesTypeScript types bundled
Known vulns00 critical · 0 high · 0 moderate · 0 low (npm audit)

Answers from our run

Does nodemon install cleanly?

Yes. In a fresh container with an empty cache, npm install nodemon finished in 2 seconds, leaving 28 packages and 3 MB on disk. npm audit reported no known vulnerabilities.

Can nodemon run in a browser?

Not directly: esbuild could not bundle it for the browser in our run, which normally means it depends on Node built-ins. Use it on the server, or find a browser-targeted alternative.

Does nodemon work with both ESM and CommonJS?

Yes. Both import 'nodemon' and require('nodemon') worked in Node 22 in our run. The package is published as CommonJS.

Does nodemon include TypeScript types?

Yes, type declarations ship inside the package, so no @types install is needed.

nodemon or tsx: which should you use?

tsx: Use tsx watch when TypeScript or ESM execution and file watching should come from one tool. nodemon 3.1.14 installed in 1.9 seconds and left 28 packages using 3 MB in our sandbox, with 0 audit findings and working CommonJS and ESM loads; it earns its devDependency when custom paths, commands, delays, or signals matter.

When should you not use nodemon?

A current Node application only needs basic restart-on-change behavior. node --watch provides that loop without adding 28 installed packages.

API stability5/5The major 3 contract still centers on watch, ignore, ext, exec, delay, signal, events, and legacyWatch, while the requireable interface keeps its event-emitter shape. Version 3.1.14 changes Windows watcher behavior without redesigning configuration or command pass-through. Long-standing quirks such as static module config and separate delay units remain. The one clear migration break is that major 3 no longer reads `.nodemonignore`.
Docs4/5The README covers installation, argument forwarding, config precedence, package.json settings, non-Node commands, multiple paths, extension lists, absolute-path ignore matching, polling, delays, signals, event commands, and stream control. The FAQ answers .env watching, ignore precedence, Docker volumes, inotify limits, and the removed `.nodemonignore` file. Exact behavior is split among the README, FAQ, CLI help, and separate module docs, so troubleshooting often crosses pages.
Maintenance4/5Release 3.1.14 shipped on February 20, 2026 with a targeted Windows watch correction. GitHub shows an unarchived repository, a push on August 19, 2026, 26,677 stars, and 12 open issues and pull requests. The package's job is mature, and recent work is compatibility and dependency upkeep rather than frequent feature expansion. That is appropriate for a watcher, though it also means old configuration oddities are unlikely to disappear quickly.
Ecosystem5/5npm recorded 13,988,643 downloads from August 19 through August 25, 2026, and GitHub reports 26,677 stars. Nodemon is common in npm scripts, container development setups, editor tasks, and tutorials; `--exec` also lets it wrap non-Node programs. Node's native watch flag and TypeScript runners now cover simpler cases, but knowledge of nodemon's configs and diagnostics remains easy to find and reuse.

Use it if

  • Your development loop needs exact watch directories, full-path ignore globs, extension filters, restart delay, or a chosen shutdown signal.
  • One watcher must restart a non-Node command through --exec or an extension-to-command map.
  • An existing project already relies on manual `rs` restarts, nodemon event hooks, or its requireable module API.
  • Changes to templates, generated config, or files outside Node's imported module graph must restart the whole application.
Skip it if

Setup reality

Our nodemon 3.1.14 install completed in 1.9 seconds in a fresh Node 22 Bookworm container. It left 28 packages and 3 MB on disk, while npm audit reported 0 known vulnerabilities at every severity. The package declares 10 direct dependencies, 0 peers, 368 KB unpacked, an MIT license, and Node 10 or newer. It bundles TypeScript declarations. require() and ESM import both worked; our esbuild browser build failed because this is Node-only process and filesystem code.

Install it in devDependencies and call the local binary from an npm script. By default, nodemon scans the working directory recursively for js, mjs, coffee, litcoffee, and json changes, while ignoring .git, node_modules, coverage, and other generated directories. Set watch and ext for a smaller tree. Ignore patterns match full absolute paths, and ignore wins over watch. Quote shell globs and use ** when they must cross directory levels.

Configuration precedence is CLI, local nodemon.json, then the global file. A local file or --config causes the package.json nodemonConfig block to be ignored rather than merged. Major 3 also stopped reading .nodemonignore; move those rules into nodemon.json. Delay values have a unit trap: JSON numbers mean milliseconds, while a bare CLI number means seconds. --verbose prints loaded configs, watched extensions, ignore rules, child PID, and restart triggers.

Docker mounts and network filesystems may not forward change events. --legacy-watch uses Chokidar polling, so narrow watch paths before enabling it. The normal restart signal is SIGUSR2; a cleanup handler must eventually exit so replacement can continue. A custom signal travels through the process tree and can reach cluster workers. The module API can only be required once because it holds static config, which makes it a poor fit for supervising independent children inside one process.

Patterns

Run the project-local watcher add-development-script

npm install --save-dev nodemon

// package.json
{
  "scripts": {
    "dev": "nodemon src/server.js"
  }
}

npm run dev

An npm script resolves the local binary, so every developer and CI job uses the version recorded in the lockfile.

Watch source and configuration only limit-watch-paths

npx nodemon \
  --watch src \
  --watch config \
  --ext js,json,yaml \
  src/server.js

Any explicit --watch option narrows monitoring to the named paths. Add every directory or individual file that can affect the child.

Exclude tests and generated output ignore-generated-files

npx nodemon \
  --ignore '**/*.test.js' \
  --ignore '**/generated/**' \
  src/server.js

Ignore rules match absolute paths and take precedence over watch rules. Quote each glob so the shell leaves it intact.

Put watcher rules in nodemon.json create-local-config

{
  "watch": ["src", "config"],
  "ext": "js,json,yaml",
  "ignore": ["**/*.test.js"],
  "delay": 500,
  "exec": "node --enable-source-maps src/server.js"
}

A JSON delay of 500 means 500 milliseconds. On the CLI, a bare delay is seconds unless the value ends in ms.

Keep configuration beside npm scripts configure-package-json

{
  "scripts": { "dev": "nodemon" },
  "nodemonConfig": {
    "watch": ["src"],
    "ignore": ["**/test/**"],
    "exec": "node src/server.js"
  }
}

A local nodemon.json or explicit --config makes nodemon ignore this entire block. The sources are not merged.

Include a dotfile in restarts watch-environment-file

npx nodemon \
  --watch src \
  --watch .env \
  --ext js,json,env \
  src/server.js

The FAQ says .env needs an explicit watch entry. Keep the source path too, because adding --watch .env alone narrows the watched set.

Restart a TypeScript entry point run-typescript-loader

npx nodemon \
  --watch src \
  --ext ts,json \
  --exec 'node --import tsx' \
  src/server.ts

nodemon does not transpile TypeScript. Install the loader separately, or use `tsx watch` when no nodemon-only option is needed.

Restart a Python process watch-non-node-command

npx nodemon \
  --watch app \
  --ext py \
  --exec 'python -u' \
  app/main.py

--exec replaces the default Node command. Set the watched extensions yourself when more than the target file can change behavior.

Fall back to polling in a container poll-bind-mount

npx nodemon \
  --legacy-watch \
  --watch src \
  src/server.js

Legacy watch polls the filesystem and can use substantial CPU on a large tree. Limit --watch before turning it on.

Delay restart after a write burst debounce-generated-writes

npx nodemon --delay 750ms src/server.js

The timer resets after each matching change. The explicit ms suffix avoids the CLI's default seconds interpretation.

Close resources before replacement handle-restart-signal

process.on('SIGUSR2', async () => {
  await server.close();
  await database.close();
  process.kill(process.pid, 'SIGTERM');
});

SIGUSR2 is nodemon's normal restart signal. The handler must terminate the child after cleanup or the new process cannot take its place.

Print loaded rules and triggers inspect-restart-decisions

npx nodemon --verbose src/server.js

Verbose mode reports config files, ignore rules, watched extensions, process IDs, matched paths, and the files that caused a restart.

Alternatives

PackageRegistryPick it when
tsxnpmUse `tsx watch` when TypeScript or ESM execution and file watching should come from one tool.
node-devnpmUse it for a Node-specific loop that restarts from the loaded module dependency tree.
pm2npmUse it for deployed process recovery, boot startup, clustering, and retained process logs.

More cli & tooling guides

commander · chalk · typescript · esbuild · yargs · click · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.