TIL — Node v18.11.0 comes with a watch mode, so you might not need nodemon
source link: https://pawelgrzybek.com/til-node-v18-11-0-comes-with-a-watch-mode-so-you-might-not-need-nodemon/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
TIL — Node v18.11.0 comes with a watch mode, so you might not need nodemon
Published: 2022.10.14 · 1 minutes read
The result of a little Twitter survey done by the Node.js team clearly shows that nodemon is one of the most helpful tools for day-to-day authoring experience. They did listen — just released version of Node.js v18.11.0 comes with a watch mode. Nice!
You can enable that using --watch
flag to watch the entry point and any imported module. To be more granular, --watch-path
allows you to specify a particular directory that should react to changes. These flags cannot be combined with --check
, --eval
, --interactive
or when used in REPL (read–eval–print loop) mode.
node --watch server.js
node --watch-path=./src --watch-path=./tests server.js
At this point, I would like to thank Remy Sharp, the creator and maintainer of nodemon. For years it has been my go-to helper tool to achieve what I described in this article (and a lot more). You might not need nodemon anymore, though — sorry, Remy 😙
Leave a comment
👆 you can use Markdown here
Save my data for the next time I comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK