Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

requires-port

Package Overview
Dependencies
0
Maintainers
2
Versions
3
Issues
File Explorer

Advanced tools

requires-port

Check if a protocol requires a certain port number to be added to an URL.

    1.0.0latest

Version published
Maintainers
2
Weekly downloads
17,533,352
decreased by-10.29%

Weekly downloads

Readme

Source

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

Keywords

FAQs

What is requires-port?

Check if a protocol requires a certain port number to be added to an URL.

Is requires-port popular?

The npm package requires-port receives a total of 14,093,781 weekly downloads. As such, requires-port popularity was classified as popular.

Is requires-port well maintained?

We found that requires-port demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 2 open source maintainers collaborating on the project.

Last updated on 30 Oct 2015

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc