JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7450
  • Score
    100M100P100Q126335F
  • License MIT

Get the netstat activity on a given port.

Package Exports

  • netstats

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (netstats) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

netstats

Get the netstat activity on a given port.

Build Status

Install

$ npm install --save netstats

Usage

const netstats = require('netstats');

netstats(8017).then(results => {
    console.log(results);
});
/*
[ 'COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME',
  'nc      20661 michael    3u  IPv4 0x3b190d9d07c2c3db      0t0  TCP *:8017 (LISTEN)',
  'nc      21145 michael    3u  IPv4 0x3b190d9d054773db      0t0  TCP *:8017 (LISTEN)',
  'Python  21221 michael    3u  IPv4 0x3b190d9ceb8dfd7b      0t0  UDP localhost:8017' ]
*/  

Returns an array containing the line output of the following commands:

  • on linux/mac: lsof -i :<port>
  • on windows: netstat.exe -a -n -o | findstr :<port>

License

MIT © Michael Wuergler