JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2949
  • Score
    100M100P100Q128829F
  • License MIT

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

Package Exports

  • connectivity

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (connectivity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.