pn
port-numbers
npm i port-numbers
pn

port-numbers

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

by silverwind

6.0.1 (see all)License:BSD-2-ClauseTypeScript:DefinitelyTyped
npm i port-numbers
Readme

port-numbers

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

Usage

npm i port-numbers
const {getService, getPort} = require('port-numbers');

getService(6379);
// { name: 'redis', description: 'An advanced key-value cache and store' }
getService(26257);
// { name: 'cockroach', description: 'CockroachDB' }
getService(123, 'udp');
// { name: 'ntp', description: 'Network Time Protocol' }

getPort('redis');
// { port: 6379, protocol: 'tcp', description: 'An advanced key-value cache and store' }
getPort('cockroach');
// { port: 26257, protocol: 'tcp', description: 'CockroachDB' }
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

Downloads/wk

2.7K

GitHub Stars

22

LAST COMMIT

2yrs ago

MAINTAINERS

1

CONTRIBUTORS

2

OPEN ISSUES

3

OPEN PRs

0
VersionTagPublished
6.0.1
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial