Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yibn2008/check-process

check exisitance of process by pid
https://github.com/yibn2008/check-process

node pid process

Last synced: 20 days ago
JSON representation

check exisitance of process by pid

Awesome Lists containing this project

README

        

# check-process

check existence of process by pid

## Usage

```js
const check = require('check-process')
const cp = require('child_process')

// return { exists: true, killable: false }
check(1)

// return { exists: true, killable: true }
let child = cp.exec(process.execPath, [someScript])
check(child.pid)
```

## API

### `check(pid)`

- `pid`, *{Number}* process PID

Check existence of process by pid.

Return a object:

```
{
exists: , // is process exists
killable: // is process killable
}
```

## LICENSE

MIT