node --watch script.js

Category: Node.js & npm/yarn

node --watch script.js

Restart the script automatically whenever the file changes — built-in alternative to nodemon (Node

Restarts the script automatically when the file is saved. Node 18+'s built-in alternative to the popular 'nodemon' package.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.