Skip to content

Check if a local or remote port is reachable

License

Notifications You must be signed in to change notification settings

abrar71/portopen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-port-reachable Build Status

Check if a local or remote port is reachable

Install

$ npm install --save is-port-reachable

Usage

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

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

API

isPortReachable(port, [options])

Returns a Promise for a boolean.

port

Type: number

options

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

About

Check if a local or remote port is reachable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%