normalize-bowser
Normalize a bowser object to a more usable form
Installation
$ npm install @f/normalize-bowser
Usage
var normalizeBowser = require('@f/normalize-bowser')
var bowser = require('bowser')
normalizeBowser(bowser)
bowser.browser // === chrome
bowser.version // === 37
API
normalizeBowser(bowser)
-
bowser
- Bowser object (as returned byrequire('bowser')
or 'bowser._detect(userAgent)`)
Returns: The same bowser object, now decorated with:
-
browser
- The name of the browser as a string (one ofchrome/safari/firefox/ie/edge/opera/ios/ie/op/and/android
). This is a restricted, normalized subset of the -
version
- The browser version number as a float -
osversion
- The OS version number as a float
License
MIT