JSPM

  • Created
  • Published
  • Downloads 6272
  • Score
    100M100P100Q146288F
  • License BSD-2-Clause

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

Package Exports

  • port-numbers

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 (port-numbers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

port-numbers

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

Installation

$ npm install --save port-numbers

Example

var pn = require("port-numbers");

pn.getService(80);
//=> { name: 'http', description: 'World Wide Web HTTP' }
pn.getService(3306);
//=> { name: 'mysql', description: 'MySQL' }
pn.getService(123, "udp");

pn.getPort('redis');
//=> { port: '6379', protocol: 'tcp', description: 'An advanced key-value cache and store' }
pn.getPort("postgresql");
//=> { port: '5432', protocol: 'tcp', description: 'PostgreSQL Database' }
pn.getPort('ntp', 'udp');
//=> { port: 123, protocol: 'udp', description: 'Network Time Protocol' }

API

.getService(port[, protocol])

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

.getPort(service[, protocol])

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

© silverwind, distributed under BSD licence