eo
electron-online
npm i electron-online
eo

electron-online

detect that your electron app is online or not.

by Gellert Hegyi

1.0.0 (see all)License:MITTypeScript:Not Found
npm i electron-online
Readme

electron-online

determine, when your electron app is online or went offline.

const ElectronOnline = require('electron-online')
const connection = new ElectronOnline()

connection.on('online', () => {
  console.log('App is online!')
})

connection.on('offline', () => {
  console.log('App is offline!')
})

console.log(connection.status) // 'PENDING'

install

$ npm i electron-online

use

connection = new require('electron-online')()

connection is an EventEmitter instance.

properties

connection.status

a string that represents the status of the app's connection. can be PENDING (when still determining the initial status), ONLINE, or OFFLINE.

events

connection.on('online')

fires, when the app comes online.

connection.on('offline')

fires, when the app becomes offline.

test

$ npm test

Downloads/wk

35

GitHub Stars

12

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

1
VersionTagPublished
1.0.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate