Direct answer
nodemon does not document whether a configured --delay timer is honored when SIGTERM or SIGINT arrives while the timer is active. For current development releases, treat termination signals as taking precedence: nodemon is expected to abort the pending restart, stop the supervised child process, and exit rather than complete the delay. No minimum or maximum --delay value is documented.
Confirmed facts
- nodemon supports --delay to postpone restarts after watched file changes.
- Documentation does not state how SIGTERM or SIGINT interacts with an active delay timer.
- Documentation does not document minimum or maximum delay values.
- Behavior can differ by nodemon version and by how nodemon is invoked, such as through npm scripts, Docker entrypoints, or process managers.
Likely behavior, not confirmed
- A pending --delay restart is probably aborted when nodemon receives SIGTERM or SIGINT.
- Invalid or negative delay values may fall back to a default or be ignored.
- Extremely large delay values remain bounded by Node.js timer limits.
- Event-loop latency and file-change batching can make actual restart intervals longer than the configured delay.
Recommended configuration
For low-traffic development, run nodemon in the foreground with a starting delay such as --delay 1000, or set delay to 1000 in nodemon.json. Send shutdown signals to the nodemon process PID itself, not only to the child Node process, so nodemon can terminate the supervised application.
Verification steps
- Check the installed version:
nodemon --version
- Start nodemon in the foreground:
nodemon --delay 1000 app.js
- Modify a watched file to activate the delay timer.
- Send SIGTERM to the nodemon PID before the restart occurs:
kill -TERM <nodemon-pid>
- Record the exit code, whether the child restarted, and nodemon log output.
- Repeat with SIGINT, and repeat with no pending file change to confirm normal shutdown behavior.
Missing diagnostic detail
Provide the exact installed nodemon version if verification results differ from the behavior described above; signal and delay handling is version-sensitive and the version can change the recommendation.
Assumptions and uncertainty
This answer assumes local development use of current nodemon releases. It does not cover graceful shutdown semantics for production workloads. Do not rely on --delay for predictable automated shutdown without verifying against the installed nodemon release notes or source.