I want to rerun the node server, whenever there's changes in file, but i want to use fswatch. i am using fswatch with the shell script like
nohup node server.js &
but i can't run the same script again since it will throw EADDRINUSE.
- whats the best way to restart the node via script with the help of fswatch (or alternate, without any new installation) ?
- Why node doesn't have something like node restart?
what i could think of is get pid from ps and kill it with script, but i guess there should be a better solution.