is-all-reachable
v1.1.3
Published
Check if a list of hosts servers are all recheable.
Downloads
5
Maintainers
Readme
is-all-reachable
Check if a list of hosts servers are all recheable.
Install
$ npm install is-all-reachable --save
Usage
const isAllReachable = require('is-all-reachable')
isAllReachable([
'http://google.com',
'http://google.es'
], (err, reachable) => {
console.log(reachable); //=> true
});
isReachable([
'http://aposddasd.com',
'http://google.com'
], (err, reachable, host) => {
console.log(reachable); //=> false
console.log(host); //=> 'http://aposddasd.com'
});
API
isAllReachable(hosts, callback)
hosts
Required
Type: array
A list of hosts to check.
callback(error, reachable, host)
Type: function
error
is there only by Node.js convention and is always null
.
reachable
Type: boolean
Is true
if all of the hosts
are reachable.
host
Type: string
First unrecheable host
found.
License
MIT © Kiko Beats.