Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

is-port-reachable

3.0.0 • 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

Install

npm i is-port-reachable

DownloadsWeekly Downloads

100,694

Version

3.0.0

License

MIT

Unpacked Size

3.21 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar