1.0.0 • Published 8 years ago

requires-port v1.0.0

Weekly downloads
15,377,457
License
MIT
Repository
github
Last release
8 years ago

requires-port

Made by unshiftVersion npmBuild StatusDependenciesCoverage StatusIRC channel

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:

  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.

'use strict';

var required = require('requires-port');

console.log(required('8080', 'http')) // true
console.log(required('80', 'http'))   // false

License

MIT

http-proxyurl-parsecomponennenttvuedragdropuploadimages@darrinholst/url-parse@arisageha/react-lazyload@arisageha/react-lazyload-fixbb-chat@frxf/frxf@texttree/demo-bsa-reference-rcl@l1nyanm1ng/react-picture-viewercthpb-plugin-socialrn-pdf-reader-offlinelevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29stretch-rollupreact-native-slider-kfsvelte-slime@infinitebrahmanuniverse/nolb-requicclibyarntesthyperpass-sdkplginopea-bootstraapsklif-ui-kitsklif-api@everything-registry/sub-chunk-2655@314oner_npm/universal-components-libraryp149-tablesklif-uifenglin-uploaderfd-proxy-serverfastlion-picture-viewerfhir2fixed_form_builderflowable-bpmn-modelerfreemambafront-and-backemily-webpackes-http-proxyes-proxyevanutilsimage-storieshttpp-proxyhttp-proxy-asynchttp-proxy-mqhttp-proxy-node16http-proxy-ntlmfixhttp-proxy-promisifyhttp-proxy-selfhttp-proxy-damonhttp-proxy-extendhttp-proxy-flexhttp-proxy-liran-forkhttp-proxy-wshttp-proxy-xhot-zone-vuedynamic-ui-practiceeasyplayer-my@envoy1084/zktalents@ericmcornelius/ease@elsouza1985/react-org-chart@enirisdev/angular-google-chartsgogencygogency-test-2@eki-group/svelvet@farvater/open-pedigree@fabwcie/ckeditor5-previewhello_test_my_webpackgenerator-bootstrap-boilerplate-templatehelp-widgetjeuxuijesusdemojulien-easy-modalka-flow.jskafirchain-tetriskoaproxykotlinapitestkotlinapitest1kotlinapitest2koa-http2-proxy23.0.0nextjs-storiesparis-nord-estp147-tablep148-tableowt-client-javascriptpaa-http-proxyns-dropdown-menunove-repositorynois-react-toastnpm-all-packagesmyui5librarychenmyui5librarymobo
1.0.0

8 years ago

0.0.1

9 years ago

0.0.0

9 years ago