Socket
Socket
Sign inDemoInstall

electron-online

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    electron-online

detect that your electron app is online or not.


Version published
Weekly downloads
40
decreased by-34.43%
Maintainers
1
Install size
4.07 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 01 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc