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 i port-numbersExample
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])
portNumber : the port to lookup. Required.protocolString : the protocol. Default:tcp.
portNumbers.getPort(service[, protocol])
serviceString : the service to lookup. Required.protocolString : the protocol. Default:tcp.
© silverwind, distributed under BSD licence