port-numbers
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -22,3 +22,3 @@ "use strict"; | ||
// filter non-matching protocols | ||
const port = entry.ports.filter(port => /\w+$/.exec(port)[0] === protocol)[0]; | ||
const port = entry.ports.find(port => /\w+$/.exec(port)[0] === protocol); | ||
if (!port) return null; | ||
@@ -25,0 +25,0 @@ |
{ | ||
"name": "port-numbers", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Get information on network port numbers and services, based on IANA's public listing", | ||
@@ -31,9 +31,9 @@ "author": "silverwind <me@silverwind.io> (https://github.com/silverwind)", | ||
"devDependencies": { | ||
"csv-parse": "4.8.8", | ||
"eslint": "6.8.0", | ||
"eslint-config-silverwind": "11.0.2", | ||
"got": "10.7.0", | ||
"jest": "25.2.3", | ||
"updates": "10.2.6", | ||
"versions": "8.2.7" | ||
"csv-parse": "4.12.0", | ||
"eslint": "7.9.0", | ||
"eslint-config-silverwind": "18.0.9", | ||
"got": "11.7.0", | ||
"jest": "26.4.2", | ||
"updates": "11.1.4", | ||
"versions": "8.4.3" | ||
}, | ||
@@ -40,0 +40,0 @@ "jest": { |
@@ -5,31 +5,30 @@ # port-numbers | ||
### Installation | ||
### Usage | ||
``` | ||
npm i port-numbers | ||
``` | ||
### Example | ||
```js | ||
const portNumbers = require('port-numbers'); | ||
const {getService, getPort} = require('port-numbers'); | ||
portNumbers.getService(6379); | ||
getService(6379); | ||
// { name: 'redis', description: 'An advanced key-value cache and store' } | ||
portNumbers.getService(26257); | ||
getService(26257); | ||
// { name: 'cockroach', description: 'CockroachDB' } | ||
portNumbers.getService(123, 'udp'); | ||
getService(123, 'udp'); | ||
// { name: 'ntp', description: 'Network Time Protocol' } | ||
portNumbers.getPort('redis'); | ||
getPort('redis'); | ||
// { port: 6379, protocol: 'tcp', description: 'An advanced key-value cache and store' } | ||
portNumbers.getPort('cockroach'); | ||
getPort('cockroach'); | ||
// { port: 26257, protocol: 'tcp', description: 'CockroachDB' } | ||
portNumbers.getPort('ntp', 'udp'); | ||
getPort('ntp', 'udp'); | ||
// { port: 123, protocol: 'udp', description: 'Network Time Protocol' } | ||
``` | ||
### APIs | ||
#### portNumbers.getService(port[, protocol]) | ||
### API | ||
#### getService(port[, protocol]) | ||
- `port` *Number* : the port to lookup. Required. | ||
- `protocol` *String* : the protocol. Default: `tcp`. | ||
#### portNumbers.getPort(service[, protocol]) | ||
#### getPort(service[, protocol]) | ||
- `service` *String* : the service to lookup. Required. | ||
@@ -36,0 +35,0 @@ - `protocol` *String* : the protocol. Default: `tcp`. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
1784550
91395
37