/network-information

provides information about the user's connection using the network information api

Primary LanguageJavaScriptMIT LicenseMIT

network-information

Provides information about the user's connection using The Network Information API. This can be used to select high definition content or low definition content.

Usage

npm install network-information --save

import Connection from 'network-information'

const connect = new Connection()
connect.init()
console.log(connect.info)

// { effectiveType: "4g", downlink: 10, saveData: false, rtt: 50 }

methods

  • init: add event listeners
  • destroy: remove event listeners

License

MIT, see LICENSE.md for details.