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

Merge pull request #284 from JBallin/readme-import-instructions

Update instructions to use default import
This commit is contained in:
Denis Demchenko 2019-01-22 21:07:07 +02:00 committed by GitHub
commit c5d18a4db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,12 +22,14 @@ _For legacy code, check out the [1.x](https://github.com/lancedikson/bowser/tree
# Use cases # 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 ```javascript
const Bowser = require("bowser"); // CommonJS const Bowser = require("bowser"); // CommonJS
import * as Bowser from "bowser" // Typescript 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. By default, the exported version is the *ES5 transpiled version*, which **do not** include any polyfills.