Skip to content

paliari/js-network-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-network-monitor

Monitor internet connection with javascript

Install with bower

$ bower install --save js-network-monitor

Install with npm

$ npm install --save js-network-monitor

Usage

<!-- Compiled JavaScript -->
<script src="bower_components/dist/js-network-monitor.js"></script>

<script>
  var options = {
    url: '/favicon.ico', // default
    timeout: 3000, // default 3 seconds
    sleep_delay: 5000, // default 5 seconds
  };
  var js_network_monitor = new JsNetworkMonitor(options);
  js_network_monitor.on('online', function() {
      console.log('you are online.');
    }
  );
  js_network_monitor.on('offline', function() {
      console.log('you are offline.');
    }
  );
  js_network_monitor.start();
</script>

About

Monitor internet connection with javascript

Resources

Stars

Watchers

Forks

Packages

No packages published