Install and import Bowser
masterBowser is a UMD module compatible with AMD, TypeScript, ES6, and CommonJS.
By default, the exported version is the ES5 transpiled version and does not include polyfills. If you are not using your own babel-polyfill, you should use the bundled version which includes babel-polyfill.
To use the bundled version with polyfills, require bowser/bundled instead of bowser.
// CommonJS
const Bowser = require("bowser");
// For bundled version with polyfills:
// const Bowser = require("bowser/bundled");
// TypeScript
import * as Bowser from "bowser";
// ES6 (and TypeScript with --esModuleInterop enabled)
import Bowser from "bowser";