npm.io
1.0.2 • Published 7 years agoCLI

connectivity

Licence
MIT
Version
1.0.2
Deps
1
Size
52 kB
Vulns
0
Weekly
0
Stars
61

connectivity travis npm downloads javascript style guide

Detect if the network is up (do we have connectivity?)

internet!

The module answers the most important question: is the cat-picture delivery system working?

usage

var connectivity = require('connectivity')

connectivity(function (online) {
  if (online) {
    console.log('connected to the internet!')
  } else {
    console.error('sorry, not connected!')
  }
})

Also works in the browser with browserify!

license

MIT. Copyright Feross Aboukhadijeh.

Keywords