Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

unshiftio/requires-port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version npmCICoverage Status

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 distributedin the public npm registry. To install it simply run the following command fromyour 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 behttp,http: or evenhttps://yomoma.com. We just splitit at: and use the first result. We currently accept the followingprotocols:
    • http
    • https
    • ws
    • wss
    • ftp
    • gopher
    • file

It returns a boolean that indicates if protocol requires this port to be addedto your URL.

'use strict';varrequired=require('requires-port');console.log(required('8080','http'))// trueconsole.log(required('80','http'))// false

License

MIT

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp