is-all-reachable

1.1.3 • Public • Published

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.

Package Sidebar

Install

npm i is-all-reachable

Weekly Downloads

1

Version

1.1.3

License

MIT

Last publish

Collaborators

  • kikobeats