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);
portNumbers.getService(26257);
portNumbers.getService(123, 'udp');
portNumbers.getPort('redis');
portNumbers.getPort('cockroach');
portNumbers.getPort('ntp', 'udp');
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