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
Install size
4.29 kB
Created

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 Build Status

Check if a local or remote port is reachable

Install

$ npm install is-port-reachable

Usage

const isPortReachable = require('is-port-reachable');

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

API

isPortReachable(port, options?)

Returns Promise<boolean>.

port

Type: number

options

Type: object

host

Type: string
Default: 'localhost'

Can be a domain or an IP.

timeout

Type: number
Default: 1000

Milliseconds to wait before giving up.

  • is-reachable - Check if servers are reachable

Keywords

FAQs

Last updated on 12 Nov 2019

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