
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
requires-port
Advanced tools
Check if a protocol requires a certain port number to be added to an URL.
The module name says it all, check if a protocol requires a given port.
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
The module exports it self as function and requires 2 arguments:
http, http: or even https://yomoma.com. We just split
it at : and use the first result. We currently accept the following
protocols:
httphttpswswssftpgopherfileIt 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
MIT
While `requires-port` helps determine if a port is required for a protocol, `is-port-reachable` checks if a port is reachable on a host. It's more about network accessibility rather than protocol requirements, making it useful for testing if services are up and accessible.
The `get-port` package is designed to find an available port on the system. Unlike `requires-port`, which is about understanding protocol defaults, `get-port` is useful for dynamically selecting an open port to avoid conflicts, especially during development or when launching new server instances.
FAQs
Check if a protocol requires a certain port number to be added to an URL.
The npm package requires-port receives a total of 32,160,016 weekly downloads. As such, requires-port popularity was classified as popular.
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.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.