pkrumins/node-tree-kill — pull request #1 by twolfson (2013-07-23 08:52:23+00:00)
Title: Added Windows support

I have added Windows support to `tree-kill`. This is achieved by using the Windows-specific command [taskkill][] with the flags to kill by `pid` (`/pid`), its tree (`/T`), and force the kill (`/F`).

[taskkill]: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/taskkill.mspx?mfr=true

If you want to granularize the signals to use `/F` only when it is a `SIGKILL` or something similar, please let me know.

Background: I am working on a `node_module` called [listen-spawn][] but was having trouble for Windows support due to not being able to tear down children of children in Windows via `process.kill()`. As I eventually discovered, this was being caused by [Windows functionality which immediately kills the process disallowing child cleanup][windows]. I eventually found that [nodemon][] uses this [technique to kill its children][kill] and decided to use it.

[listen-spawn]: https://github.com/twolfson/listen-spawn
[windows]: https://github.com/joyent/node/issues/3259#issuecomment-5668754
[nodemon]: https://github.com/remy/nodemon
[kill]: https://github.com/remy/nodemon/blob/c4fa8911a057c98c6daa8ea2197310360e0d0392/nodemon.js#L404-L405