is-port-reachable
Check if a local or remote port is reachable
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-port-reachable 
SYNC missed versions from official npm registry.

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.

Related

Current Tags

  • 4.0.0                                ...           latest (5 years ago)

6 Versions

  • 4.0.0                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 54
This Month 81
Last Day 3
Last Week 63
Last Month 471
Dependencies (0)
None
Dev Dependencies (3)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |