Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
is-port-reachable
Advanced tools
The is-port-reachable npm package is used to check if a port is reachable on a given host. It is useful for network diagnostics and monitoring, allowing developers to programmatically verify if services are accessible over the network.
Check port reachability
This feature allows you to check if a specific port on a host is reachable. The function returns a boolean indicating whether the port is open or not.
const isPortReachable = require('is-port-reachable');
(async () => {
const reachable = await isPortReachable(80, {host: 'example.com'});
console.log(reachable); // true or false
})();
The portscanner package is similar to is-port-reachable and provides more comprehensive functionality for scanning ports, including checking a range of ports and providing detailed status for each port.
tcp-ping allows you to perform TCP pings to a server, which includes checking if a port is open. It provides additional information such as latency measurements, which is-port-reachable does not offer.
wait-for-port is another package that can be used to wait for a port on a host to become available. It is useful for scenarios where you need to wait for a service to start up before performing actions that depend on that service.
Check if a local or remote port is reachable
npm install is-port-reachable
import isPortReachable from 'is-port-reachable';
console.log(await isPortReachable(80, {host: 'google.com'}));
//=> true
Returns Promise<boolean>
for whether the port is reachable.
Type: number
The port to check.
Type: object
Required
Type: string
Example: 'localhost'
The host to check.
Can be a domain (optionally, with a sub-domain) or an IP address.
Type: number
Default: 1000
The time to wait in milliseconds before giving up.
FAQs
Check if a local or remote port is reachable
The npm package is-port-reachable receives a total of 1,128,168 weekly downloads. As such, is-port-reachable popularity was classified as popular.
We found that is-port-reachable 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.