getonline

1.0.0 • Public • Published

getonline

NPM Version Coverage Status Build Status Downloads Dependency Status License

listen to internet connection status

Install

npm i -D getonline

Usage

var Online=require('getonline');
const internet=new Online({timeout:3000}) // default to 3s
 
internet.on('connected',function(){
      console.log('you are online !');
}) 
 
internet.on('disconnected',function(){
      console.log('disconnected...');
}) 

API

getonline([options])

options

Type: Object

timeout

Type: number
Default: 5000

Milliseconds interval to check status again.

License

MIT © abdelhak akermi

Package Sidebar

Install

npm i getonline

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • darvour