Check if a local or remote port is reachable
$ npm install --save is-port-reachable
const isPortReachable = require('is-port-reachable');
isPortReachable(80, {host: 'google.com'}).then(reachable => {
console.log(reachable);
//=> true
});
Returns a Promise
for a boolean
.
Type: number
Type: string
Default: localhost
Can be a domain or an IP.
Type: number
Default: 1000
Milliseconds to wait before giving up.
- is-reachable - Check if servers are reachable
MIT © Sindre Sorhus