1 | # airbnb-js-shims <sup>[![Version Badge][2]][1]</sup>
|
2 |
|
3 | JS language shims used by Airbnb.
|
4 |
|
5 | Just require/import `airbnb-js-shims`, and the environment will be shimmed.
|
6 |
|
7 | ```js
|
8 | import 'airbnb-js-shims';
|
9 | ```
|
10 |
|
11 | ## Included shims
|
12 |
|
13 | - [es5-shim](https://www.npmjs.com/package/es5-shim)
|
14 | - [es5-sham](https://www.npmjs.com/package/es5-shim)
|
15 | - [es6-shim](https://www.npmjs.com/package/es6-shim)
|
16 | - [Array.prototype.includes](https://www.npmjs.com/package/array-includes) (ES7/ES2016)
|
17 | - [Object.entries](https://www.npmjs.com/package/object.entries) (ES8/ES2017)
|
18 | - [Object.values](https://www.npmjs.com/package/object.values) (ES8/ES2017)
|
19 | - [String.prototype.padStart](https://www.npmjs.com/package/string.prototype.padstart) (ES8/ES2017)
|
20 | - [String.prototype.padEnd](https://www.npmjs.com/package/string.prototype.padend) (ES8/ES2017)
|
21 |
|
22 | ## Targeting versions
|
23 |
|
24 | If you do not need to support older browsers, you can pick a subset of ES versions to target. For example, if you don't support pre-ES5 browsers, you can start your shims with ES2015 by requiring/importing the specific target file. This will shim the environment for that version and upward.
|
25 |
|
26 | ```js
|
27 | import 'airbnb-js-shims/target/es2015';
|
28 | ```
|
29 |
|
30 | ### Included targets
|
31 |
|
32 | - `airbnb-js-shims/target/es5` (default)
|
33 | - `airbnb-js-shims/target/es2015`
|
34 | - `airbnb-js-shims/target/es2016`
|
35 | - `airbnb-js-shims/target/es2017`
|
36 |
|
37 | [1]: https://npmjs.org/package/airbnb-js-shims
|
38 | [2]: http://versionbadg.es/airbnb/js-shims.svg
|