Browser detection using the user agent, returns the name and version of the browser
npm install browser-version-detection




Browser detection using the user agent.
Tested on most popular browser in the World on October 2017, statistic gets from StatCounter.
> It's worth re-iterating: it's very rarely a good idea to use user agent sniffing. You can almost always find a better, more broadly compatible way to solve your problem!
> > More details here
Installation
```
npm i browser-version-detection`
Script returns object with browser name and version, for example:javascript`
const output = {
name: 'Chrome',
version: 62,
}`
Call it where you wantjavascript`
browserDetection.detectBrowser(window.navigator);`
in case if you need only namejavascript``
browserDetection.detectBrowserName(window.navigator.userAgent)`
in case if you need only versionjavascript``
const name = browserDetection.detectBrowserName(window.navigator.userAgent);
browserDetection.detectBrowserVersion(window.navigator, name)`
Note: also it's possible to use npm instead of yarn.
Minified script located in dist/`` folder
yarn install
yarn run start
yarn test