Bakhtina Sofya b84cb877be 1st comm | 2 هفته پیش | |
---|---|---|
.. | ||
index.js | 2 هفته پیش | |
license | 2 هفته پیش | |
package.json | 2 هفته پیش | |
readme.md | 2 هفته پیش |
Check if a process is running
$ npm install process-exists
const processExists = require('process-exists');
processExists(process.pid).then(exists => {
console.log(exists);
//=> true
});
processExists.all([process.pid, 'foo']).then(exists => {
console.log(exists.get(process.pid));
//=> true
console.log(exists.get('foo'));
//=> false
console.log(processExists.filterExists(exists));
//=> [process.pid]
});
Returns a Promise<boolean>
.
Type: number
string
Process ID or name to check.
Returns a Promise<Map>
with the process name/ID as key and the status as a boolean value.
Type: Array<number|string>
Process IDs or names to check.
Returns an Array<number|string>
with the processes that exist.
Type: Array<number|string>
Process IDs or names to check.
MIT © Sindre Sorhus