Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

process-exists

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

process-exists - npm Package Compare versions

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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc