Search code examples
node.jsnpmsupervisordforevernode-supervisor

Prevent developers from unintentionally killing daemon / worker processes on local machine


A lot of newbs will kill all their node.js processes on their local machines with

pkill -f node

Or

killall node

Etc.

I have a library that uses some daemon processes/workers running on the developer's machine and I will need to restart them if the development "accidentally" kills (all) node.js processes.

The problem is that using NPM libs like forever or supervisor will not solve this problem because they are node.js processes as well TMK.

Can anyone recommend a daemon watcher / relauncher system that will work on MacOS or *nix?

Perhaps supervisord can do what I want to do on both MacOS and *nix? Or perhaps there is another solution to this problem?


Solution

  • I wrote node-windows, node-mac, and node-linux for this purpose. They are essentially wrappers around node processes, but all three libraries share a common API for managing things like restarts/stop/start/etc.