port-numbers
Advanced tools
Comparing version 7.1.0 to 8.0.0
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
550635
3
0
30
2