Skip to content

Commit

Permalink
Merge branch 'release/2.0.0-alpha.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
lancedikson committed Aug 2, 2018
2 parents 4e6aa12 + 818040b commit 2c5ab93
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Bowser Changelog

### 2.0.0-alpha.4 (August 2, 2018)
- [DOCS] Fix usage docs (#238)
- [CHANGE] Make `./es5.js` the main file of the package (#239)

### 2.0.0-alpha.3 (July 22, 2018)
- [CHANGE] Rename split and rename `compiled.js` to `es5.js` and `bundled.js` (#231, #236, #237)
- [ADD] Add `Parser.some` (#235)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -26,15 +26,14 @@ First of all, require the library:
const bowser = require('bowser');
```

By default, `require('bowser')` requires the *ES6 version of files*, which
By default, `require('bowser')` requires the *ES5 version of files*, which
**do not** include any polyfills.

In case if you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills.
So, for you it's suitable to require bowser like this: `require('bowser/bundled')`.
As the result, you get a ES5 version of bowser with `babel-polyfill` bundled together.

If you use bowser for Node.js, you'd better use `require('bowser/es5')`,
since source files have `import` statements, which are not compatible with Node.js yet.
You may need to use the source files, so they will be available in the package as well.

## Browser props detection

Expand Down Expand Up @@ -92,7 +91,7 @@ You could want to filter some particular browsers to provide any special support
It could look like this:

```javascript
const browser = bowser.getParsers(window.navigator.userAgent);
const browser = bowser.getParser(window.navigator.userAgent);
const isValidBrowser = browser.satisfies({
// declare browsers per OS
windows: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "bowser",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"description": "Lightweight browser detector",
"keywords": [
"browser",
Expand All @@ -20,7 +20,7 @@
"url": "http://twitter.com/lancedikson"
}
],
"main": "src/bowser.js",
"main": "es5.js",
"repository": {
"type": "git",
"url": "git+https://github.com/lancedikson/bowser.git"
Expand Down
2 changes: 1 addition & 1 deletion src/bowser.js
Expand Up @@ -26,7 +26,7 @@ class Bowser {
* const bowser = new Bowser(window.navigator.userAgent);
* bowser.getResult()
*/
static getParser(UA, skipParsing=false) {
static getParser(UA, skipParsing = false) {
if (typeof UA !== 'string') {
throw new Error('UserAgent should be a string');
}
Expand Down

0 comments on commit 2c5ab93

Please sign in to comment.