139 MB
104 files
Updated 3 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| .npmignore | 22 Bytes xet | 91b3270f | |
| .travis.yml | 341 Bytes xet | f28a950a | |
| LICENSE | 1.12 kB xet | 9cb17334 | |
| README.md | 1.81 kB xet | 7cb1de9b | |
| index.js | 753 Bytes xet | 98aa52fc | |
| package.json | 1.13 kB xet | 776512d0 | |
| test.js | 3.39 kB xet | 44c60598 |
requires-port
The module name says it all, check if a protocol requires a given port.
Installation
This module is intended to be used with browserify or Node.js and is distributed in the public npm registry. To install it simply run the following command from your CLI:
npm install --save requires-port
Usage
The module exports it self as function and requires 2 arguments:
- The port number, can be a string or number.
- Protocol, can be
http,http:or evenhttps://yomoma.com. We just split it at:and use the first result. We currently accept the following protocols:httphttpswswssftpgopherfile
It returns a boolean that indicates if protocol requires this port to be added to your URL.
'use strict';
var required = require('requires-port');
console.log(required('8080', 'http')) // true
console.log(required('80', 'http')) // false
License
MIT
- Total size
- 139 MB
- Files
- 104
- Last updated
- Apr 4
- Pre-warmed CDN
- US EU US EU