ps command wrapper. Promise implementation on top of github.com/neekey/ps
npm install node-ps-promisenode-ps
================================================================================
node-ps is ps tool wrapper implementing promises.
node-ps wraps neekey's ps-node library
Installation
--------------------------------------------------------------------------------
Install with npm.
``bash`
npm install node-ps
or Clone from github
`bash`
git clone http://github.com/sgen/node-ps
Usage
--------------------------------------------------------------------------------
For full usage see neekey's node-ps library. lookup and kill function identically with the exception of the replacement of the callbacks with promises;
Lookup a process
`javscript
var ps = require('node-ps');
ps.lookup({
pid: 123
}).then(function(results) {
for (i = 0; i < results.length; i++) {
console.log('Result %s: %s', i, results[i])
}
}).catch(function(err) {
console.error(err);
});
`
Kill a process
`javscript
var ps = require('node-ps');
ps.kill(123).then(function(pid) {
console.log(pid);
}).catch(function(err) {
console.error(err);
});
``