Socket
Socket
Sign inDemoInstall

port-numbers

Package Overview
Dependencies
0
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

port-numbers


Version published
Maintainers
1
Created

Readme

Source

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

Keywords

FAQs

Last updated on 21 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc