Socket
Book a DemoInstallSign in
Socket

is-port-reachable

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-port-reachable

Check if a local or remote port is reachable

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
2M
3.75%
Maintainers
2
Weekly downloads
 
Created
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

port

FAQs

Package last updated on 19 Sep 2021

Did you know?

Socket

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