Socket
Socket
Sign inDemoInstall

is-port-reachable

Package Overview
Dependencies
0
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-port-reachable

Check if a local or remote port is reachable


Version published
Maintainers
2
Weekly downloads
1,436,323
decreased by-2.88%

Weekly downloads

Package description

What is is-port-reachable?

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.

What are is-port-reachable's main functionalities?

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
})();

Other packages similar to is-port-reachable

Readme

Source

is-port-reachable

Check if a local or remote port is reachable

Install

npm install is-port-reachable

Usage

import isPortReachable from 'is-port-reachable';

console.log(await isPortReachable(80, {host: 'google.com'}));
//=> true

API

isPortReachable(options)

Returns Promise<boolean> for whether the port is reachable.

port

Type: number

The port to check.

options

Type: object

host

Required
Type: string
Example: 'localhost'

The host to check.

Can be a domain (optionally, with a sub-domain) or an IP address.

timeout

Type: number
Default: 1000

The time to wait in milliseconds before giving up.

  • is-reachable - Check if servers are reachable

Keywords

FAQs

Last updated on 19 Sep 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc