* Bump tough-cookie and @azure/ms-rest-js Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) and [@azure/ms-rest-js](https://github.com/Azure/ms-rest-js). These dependencies needed to be updated together. Updates `tough-cookie` from 4.0.0 to 4.1.3 - [Release notes](https://github.com/salesforce/tough-cookie/releases) - [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md) - [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3) Updates `@azure/ms-rest-js` from 2.6.2 to 2.7.0 - [Changelog](https://github.com/Azure/ms-rest-js/blob/master/Changelog.md) - [Commits](https://github.com/Azure/ms-rest-js/commits) --- updated-dependencies: - dependency-name: tough-cookie dependency-type: indirect - dependency-name: "@azure/ms-rest-js" dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
47 lines
1.8 KiB
Markdown
47 lines
1.8 KiB
Markdown
# requires-port
|
|
|
|
[](http://unshift.io)[](http://browsenpm.org/package/requires-port)[](https://travis-ci.org/unshiftio/requires-port)[](https://david-dm.org/unshiftio/requires-port)[](https://coveralls.io/r/unshiftio/requires-port?branch=master)[](http://webchat.freenode.net/?channels=unshift)
|
|
|
|
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:
|
|
|
|
```j
|
|
npm install --save requires-port
|
|
```
|
|
|
|
## Usage
|
|
|
|
The module exports it self as function and requires 2 arguments:
|
|
|
|
1. The port number, can be a string or number.
|
|
2. Protocol, can be `http`, `http:` or even `https://yomoma.com`. We just split
|
|
it at `:` and use the first result. We currently accept the following
|
|
protocols:
|
|
- `http`
|
|
- `https`
|
|
- `ws`
|
|
- `wss`
|
|
- `ftp`
|
|
- `gopher`
|
|
- `file`
|
|
|
|
It returns a boolean that indicates if protocol requires this port to be added
|
|
to your URL.
|
|
|
|
```js
|
|
'use strict';
|
|
|
|
var required = require('requires-port');
|
|
|
|
console.log(required('8080', 'http')) // true
|
|
console.log(required('80', 'http')) // false
|
|
```
|
|
|
|
# License
|
|
|
|
MIT
|