I'm not looking for a file watcher like nodemon
I have the following scenario:
I'm running a script script.js
in nodeJS
, In some cases I have to switch to a different git
branch (I know how to do this part).
After the git
branch is switched, I would like to exit the current run and reload script.js
again.
How do I cause nodeJS
to reload and run the same script again?
Do I need to start another process and exit the current one?