Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/luckydrq/find-pid

**Cross-platform** methods of finding process pid.
https://github.com/luckydrq/find-pid

utility

Last synced: 3 days ago
JSON representation

**Cross-platform** methods of finding process pid.

Awesome Lists containing this project

README

        

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![build status][appveyor-image]][appveyor-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

Cross-platform api of finding pid under specified conditions.

[npm-image]: https://img.shields.io/npm/v/find-pid.svg?style=flat-square
[npm-url]: https://npmjs.org/package/find-pid
[travis-image]: https://img.shields.io/travis/luckydrq/find-pid/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/luckydrq/find-pid
[appveyor-image]: https://ci.appveyor.com/api/projects/status/c8wxxgyd62cx1ejs?svg=true
[appveyor-url]: https://travis-ci.org/luckydrq/find-pid
[codecov-image]: https://codecov.io/gh/luckydrq/find-pid/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/luckydrq/find-pid
[david-image]: https://img.shields.io/david/luckydrq/find-pid.svg?style=flat-square
[david-url]: https://david-dm.org/luckydrq/find-pid
[snyk-image]: https://snyk.io/test/npm/find-pid/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/find-pid
[download-image]: https://img.shields.io/npm/dm/find-pid.svg?style=flat-square
[download-url]: https://npmjs.org/package/find-pid

## Install
`$ npm i find-pid`

*Note: For some linux distributions, `netstat` is not available util
you install `net-tools`, run `sudo apt-get install net-tools`.*

## Example
```js
const findByPort = require('find-pid').byPort;
findByPort(7777, (err, pid) => {
console.log(pid);
});
```

## API

- byPort(port, callback)

Find pid by port.

## Contribute
Now the only api is `byPort`, other features is not planned until i
really need it. But i am very happy to accept a PR :)

## License
MIT