Package Exports
- tree-kill
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tree-kill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Tree Kill
Kill all processes in the process tree, including the root process.
Example
Kill all the children processes of the process with pid 1
, including the process with pid 1
itself:
var kill = require('tree-kill');
kill(1, 'SIGKILL');
Supports callbacks with error handling:
var kill = require('tree-kill');
kill(1, 'SIGKILL', function(err) {
// Do things
});
Methods
require('tree-kill')(pid, [signal], [callback]);
Sends signal signal
to all children processes of the process with pid pid
, including pid
. Signal defaults to SIGTERM
.
For Linux, this uses ps -o pid --no-headers --ppid PID
to find the parent pids of PID
.
For Windows, this uses 'taskkill /pid PID /T /F'
to kill the process tree.
Install
With npm do:
npm install tree-kill
License
MIT