npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

is-port-reachable

2.0.1 • Public • Published

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.

Related

License

MIT © Sindre Sorhus

install

npm i is-port-reachable

Downloadsweekly downloads

20,071

version

2.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability