is-reachable
Check if servers are reachable
Works in Node.js and the browser (with browserify).
Install
$ npm install --save is-reachable
Usage
const isReachable = require('is-reachable');
isReachable('sindresorhus.com').then(reachable => {
console.log(reachable);
});
isReachable('google.com:80').then(reachable => {
console.log(reachable);
});
API
isReachable(hosts)
Returns a Promise
for a boolean
which is true
if any of the hosts
are reachable.
hosts
Type: string
Array
One or more hosts to check.
Contributors
Related
- is-online - Check if the internet connection is up
License
MIT © Sindre Sorhus