network-information
v1.0.1
Published
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.
Downloads
201
Readme
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 listenersdestroy
: remove event listeners
License
MIT, see LICENSE.md for details.