The new version 18 for Node.js comes with a watch mode, so you might not need nodemon.
You can enable that using the –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 known as read–eval–print loop mode.
Just start your javascript-named index.js like this and make changes on fly:
1 2 3 | node --watch index.js // or use the path to the folder of index.js node --watch-path=./src --watch-path=./tests index.js |