Socket
Socket
Sign inDemoInstall

port-numbers

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

port-numbers - npm Package Compare versions

Comparing version 7.1.0 to 8.0.0

index.json

23

package.json
{
"name": "port-numbers",
"version": "7.1.0",
"description": "Get information on network port numbers and services, based on IANA's public listing",
"version": "8.0.0",
"description": "Holds information on network port numbers, based on IANA's data",
"author": "silverwind",

@@ -10,21 +10,18 @@ "repository": "silverwind/port-numbers",

"sideEffects": false,
"engines": {
"node": ">=16"
},
"main": "./index.json",
"exports": "./index.json",
"files": [
"./index.js",
"./ports.json",
"./services.json"
"./index.json"
],
"devDependencies": {
"d3-dsv": "3.0.1",
"eslint": "8.43.0",
"eslint-config-silverwind": "73.0.4",
"eslint": "8.44.0",
"eslint-config-silverwind": "73.1.2",
"fetch-enhanced": "11.1.1",
"undici": "5.22.1",
"updates": "14.2.9",
"updates": "14.3.2",
"versions": "11.0.1",
"vitest": "0.32.2",
"vitest-config-silverwind": "2.0.0"
"vitest": "0.33.0",
"vitest-config-silverwind": "2.1.0"
}
}
# port-numbers
[![](https://img.shields.io/npm/v/port-numbers.svg?style=flat)](https://www.npmjs.org/package/port-numbers) [![](https://img.shields.io/npm/dm/port-numbers.svg)](https://www.npmjs.org/package/port-numbers) [![](https://packagephobia.com/badge?p=port-numbers)](https://packagephobia.com/result?p=port-numbers)
> Get information on network port numbers and services, based on [IANA's public listing](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml).
npm module that holds information on network port numbers based on [IANA's data](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml).
### Usage
```
npm i port-numbers
```
```js
import {getService, getPort} from "port-numbers";
import ports from "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' }
ports["6379/tcp"];
// ["redis", "An advanced key-value cache and store"]
ports["123/udp"];
// ["ntp", "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`.
The export is a JSON object in with `port/proto` as key and `[name, description]` as value.
```json
{
"6379/tcp": [
"redis",
"An advanced key-value cache and store"
]
}
```
© [silverwind](https://github.com/silverwind), distributed under BSD licence
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc