Skip to content

micro-js/normalize-bowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

normalize-bowser

Build status Git tag NPM version Code style

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 by require('bowser') or 'bowser._detect(userAgent)`)

Returns: The same bowser object, now decorated with:

  • browser - The name of the browser as a string (one of chrome/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

About

Normalize a bowser object to a more usable form

Resources

Stars

Watchers

Forks

Packages

No packages published