is-all-reachable

Check if a list of hosts servers are all recheable.


Keywords
accessible, all, browser, connected, connectivity, detect, has, host, hosts, internet, is, network, offline, online, reachability, reachable, server, socket
License
MIT
Install
npm install is-all-reachable@1.1.3

Documentation

is-all-reachable

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

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.