port-numbers 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -24
- package/index.json +1 -0
- package/package.json +10 -13
- package/index.js +0 -31
- package/ports.json +0 -48987
- package/services.json +0 -43106
package/README.md
CHANGED
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
# port-numbers
|
|
2
2
|
[](https://www.npmjs.org/package/port-numbers) [](https://www.npmjs.org/package/port-numbers) [](https://packagephobia.com/result?p=port-numbers)
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
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).
|
|
5
5
|
|
|
6
6
|
### Usage
|
|
7
|
-
```
|
|
8
|
-
npm i port-numbers
|
|
9
|
-
```
|
|
10
7
|
```js
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
getService(6379);
|
|
14
|
-
// { name: 'redis', description: 'An advanced key-value cache and store' }
|
|
15
|
-
getService(26257);
|
|
16
|
-
// { name: 'cockroach', description: 'CockroachDB' }
|
|
17
|
-
getService(123, 'udp');
|
|
18
|
-
// { name: 'ntp', description: 'Network Time Protocol' }
|
|
8
|
+
import ports from "port-numbers";
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
getPort('ntp', 'udp');
|
|
25
|
-
// { port: 123, protocol: 'udp', description: 'Network Time Protocol' }
|
|
10
|
+
ports["6379/tcp"];
|
|
11
|
+
// ["redis", "An advanced key-value cache and store"]
|
|
12
|
+
ports["123/udp"];
|
|
13
|
+
// ["ntp", "Network Time Protocol"]
|
|
26
14
|
```
|
|
27
15
|
|
|
28
16
|
### API
|
|
29
|
-
#### getService(port[, protocol])
|
|
30
|
-
- `port` *Number* : the port to lookup. Required.
|
|
31
|
-
- `protocol` *String* : the protocol. Default: `tcp`.
|
|
32
17
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
The export is a JSON object in with `port/proto` as key and `[name, description]` as value.
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"6379/tcp": [
|
|
23
|
+
"redis",
|
|
24
|
+
"An advanced key-value cache and store"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
```
|
|
36
28
|
|
|
37
29
|
© [silverwind](https://github.com/silverwind), distributed under BSD licence
|