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.
npm install network-informationProvides information about the user's connection using The Network Information API. This can be used to select high definition content or low definition content.
npm install network-information --save
``javascript
import Connection from 'network-information'
const connect = new Connection()
connect.init()
console.log(connect.info)
// { effectiveType: "4g", downlink: 10, saveData: false, rtt: 50 }
`
- init: add event listenersdestroy`: remove event listeners
-
MIT, see LICENSE.md for details.