portproc-core

0.0.1 • Public • Published

PortProc

A utility to:

  • get the ID of the process currently using a given port
  • get the port currently in use by a given process ID

Installation

npm install --save portproc-core

Usage

const { portToProc, procToPort } = require("portproc");
 
// Get the PID of the process using port 3000
portToProc(3000)
    .then(proc => console.log("process id: " + proc);
 
// Get the port that process '54321' is currently using
procToPort(54321)
    .then(port => console.log("port: " + port));

Both utilities take in an integer number, and return a promise.

If you provide a port or process ID and no match can be found, the promise will reject.

Package Sidebar

Install

npm i portproc-core

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

4.93 kB

Total Files

3

Last publish

Collaborators

  • coffeedoughnuts