Get the network type.
$ npm install --save network-type
const networkType = require('network-type');
networkType();
//=> { type: 'UMTS', version: '3G', downlinkMax: '2' }
Type would be on of the:
bluetooth
cellular
ethernet
none
wifi
wimax
other
unknown
MIT © Hemanth.HM