process-exists
Advanced tools
Comparing version 1.0.0 to 2.0.0
13
index.js
'use strict'; | ||
var psList = require('ps-list'); | ||
var pify = require('pify'); | ||
var Promise = require('pinkie-promise'); | ||
module.exports = function (proc, cb) { | ||
module.exports = function (proc) { | ||
var fn = function (x) { | ||
@@ -15,10 +17,5 @@ return x.pid === proc; | ||
psList(function (err, list) { | ||
if (err) { | ||
cb(err); | ||
return; | ||
} | ||
cb(null, list.some(fn)); | ||
return pify(psList, Promise)().then(function (list) { | ||
return list.some(fn); | ||
}); | ||
}; |
{ | ||
"name": "process-exists", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Check if a process is running", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -35,8 +35,16 @@ "files": [ | ||
"dependencies": { | ||
"pify": "^2.2.0", | ||
"pinkie-promise": "^1.0.0", | ||
"ps-list": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "0.0.4", | ||
"noop-process": "^1.0.1" | ||
"ava": "*", | ||
"noop-process": "^2.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"ignores": [ | ||
"test.js" | ||
] | ||
} | ||
} |
@@ -16,5 +16,5 @@ # process-exists [![Build Status](https://travis-ci.org/sindresorhus/process-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/process-exists) | ||
```js | ||
var processExists = require('process-exists'); | ||
const processExists = require('process-exists'); | ||
processExists(process.pid, function (err, exists) { | ||
processExists(process.pid).then(exists => { | ||
console.log(exists); | ||
@@ -28,4 +28,6 @@ //=> true | ||
### processExists(input, callback) | ||
### processExists(input) | ||
Returns a promise for a `boolean`. | ||
#### input | ||
@@ -37,9 +39,5 @@ | ||
#### callback(error, exists) | ||
Type: `function` | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2902
3
3
17
41
+ Addedpify@^2.2.0
+ Addedpinkie-promise@^1.0.0
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@1.0.0(transitive)
+ Addedpinkie-promise@1.0.0(transitive)