Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 2, 2024 via pnpm

requires-port 1.0.0

Check if a protocol requires a certain port number to be added to an URL.
Package summary
Share
0
issues
1
license
1
MIT
Package created
7 Nov 2014
Version published
30 Oct 2015
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
requires-port@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of requires-port 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does requires-port do?

"requires-port" is a useful npm package built by unshift. The purpose of this package is to check if a specific protocol necessitates the inclusion of a particular port number in an URL. This feature is crucial in many instances where unique port specifications are required for different protocols. The package supports several protocols, including http, https, ws, wss, ftp, gopher and file.

How do you use requires-port?

To use the "requires-port" package in your project, start by installing it. This package is designed for use with browserify or Node.js, and you can find it in the public npm registry. You can install it directly from your command-line interface with the command npm install --save requires-port.

The module exports itself as a function and needs two arguments: the port number and the protocol. The port number can be either a string or a number, and the protocol can be http, http: or even an entire URL like https://yomoma.com. The method will simply split the input at the colon and use the initial result.

Below is an example of how to implement "requires-port" in your code:

'use strict';

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

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

In this example, the function checks whether the 'http' protocol requires the specified ports '8080' and '80'. The outputs 'true' and 'false' indicate whether or not the ports are required.

Where are the requires-port docs?

You can find the complete and up-to-date documentation for the "requires-port" package on the official GitHub page requires-port GitHub page. This is the best place to get familiarized with the package, understand its functionality in detail, and stay updated on the latest changes and improvements made by the package maintainers. Whether you are a seasoned developer or a newbie, the advanced yet straightforward documentation will guide you through the ins and outs of the "requires-port" package.

All Versions