socketioMEANseed/www/node_modules/requires-port/README.md
www/node_modules/requires-port/README.mdRaw
1# requires-port
2
3[](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)
4
5The module name says it all, check if a protocol requires a given port.
6
7## Installation
8
9This module is intended to be used with browserify or Node.js and is distributed
10in the public npm registry. To install it simply run the following command from
11your CLI:
12
13```j
14npm install --save requires-port
15```
16
17## Usage
18
19The module exports it self as function and requires 2 arguments:
20
211. The port number, can be a string or number.
222. Protocol, can be `http`, `http:` or even `https://yomoma.com`. We just split
23 it at `:` and use the first result. We currently accept the following
24 protocols:
25 - `http`
26 - `https`
27 - `ws`
28 - `wss`
29 - `ftp`
30 - `gopher`
31 - `file`
32
33It returns a boolean that indicates if protocol requires this port to be added
34to your URL.
35
36```js
37'use strict';
38
39var required = require('requires-port');
40
41console.log(required('8080', 'http')) // true
42console.log(required('80', 'http')) // false
43```
44
45# License
46
47MIT