Narrating Prophetic Monks
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

port-numbers

4.0.4 • Public • Published

port-numbers

Get information on network port numbers and services, based on IANA's public listing.

Installation

$ npm i port-numbers

Example

const portNumbers = require('port-numbers');
 
portNumbers.getService(6379);
//=> { name: 'redis', description: 'An advanced key-value cache and store' }
portNumbers.getService(26257);
//=> { name: 'cockroach', description: 'CockroachDB' }
portNumbers.getService(123, 'udp');
//=> { name: 'ntp', description: 'Network Time Protocol' }
 
portNumbers.getPort('redis');
//=> { port: 6379, protocol: 'tcp', description: 'An advanced key-value cache and store' }
portNumbers.getPort('cockroach');
//=> { port: 26257, protocol: 'tcp', description: 'CockroachDB' }
portNumbers.getPort('ntp', 'udp');
//=> { port: 123, protocol: 'udp', description: 'Network Time Protocol' }

APIs

portNumbers.getService(port[, protocol])

  • port Number : the port to lookup. Required.
  • protocol String : the protocol. Default: tcp.

portNumbers.getPort(service[, protocol])

  • service String : the service to lookup. Required.
  • protocol String : the protocol. Default: tcp.

© silverwind, distributed under BSD licence

install

npm i port-numbers

Downloadsweekly downloads

18,288

version

4.0.4

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability