Simple process mgr for mac/win to force kill and gracefully terminate processes. Can also send signals to a process by name. Future development will add further features.
npm install ps4jsps and tasklist to list processes and kill and taskkill to kill a process.
sigkill (9) or sigterm (15))
bash
$ npm install ps4js
`
Usage
$3
`javascript
var ps = require('ps4js');
ps.list(function(err, results) {
if (err)
throw new Error( err );
console.log(results); // [{pid: 2352, command: 'command'}, {...}]
});
`
$3
`javascript
var ps = require('ps4js');
ps.kill(12345, function(err, stdout) {
if (err)
throw new Error(err);
console.log(stdout); // stdout for kill or taskkill command if any
});
`
Tests
`bash
npm test
``