1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Add ES6 import example

This commit is contained in:
JBallin 2019-01-22 09:09:48 -08:00
parent fed702a148
commit 73be17508d

View File

@ -20,12 +20,14 @@ The upcoming 2.0 version has drastically changed API. All available methods can
# Use cases
First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript and CommonJS module systems.
First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.
```javascript
const Bowser = require("bowser"); // CommonJS
import * as Bowser from "bowser"; // TypeScript
import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInterop enabled)
```
By default, the exported version is the *ES5 transpiled version*, which **do not** include any polyfills.