--watch
A Node.js flag that restarts your program automatically whenever one of the files it loaded changes.
In more detail
node --watch server.js is handy in development and replaces tools such as nodemon. --watch-path lets you choose which folders to watch.
Related terms
- hot reloading — Having a running program pick up code changes automatically, without rebuilding or restarting by hand.
- command-line flag — An option typed after a program's name to change how it runs, such as --watch in node --watch server.js.
Taught in
- Runtime Configuration: CLI Flags & Native --env-file — Node.js Internals & Backend Services