indexzero/forever — pull request #136 by mmalecki (2011-10-10 20:47:37+00:00)
Title: Use `process.kill` for checking if process is alive

This solution is way nicer than spawning `ps`.

Only difference is: `ps` checks only for processes on current shell and `process.kill` checks all processes. However, I'm pretty sure that it won't cause any problems.

About Windows compatibility: this solution isn't Windows-compatible *now* (`process.kill(pid, 0)` just kills `pid` on Windows), but AFAIK, it it's getting fixed.