Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
airbnb-js-shims
Advanced tools
The airbnb-js-shims package is a collection of JavaScript shims and polyfills used by Airbnb. It helps in ensuring that JavaScript code runs smoothly across different environments by providing compatibility for features that may not be available in older browsers or certain environments. This package is particularly useful for developers looking to support a wide range of browsers without having to worry about the availability of modern JavaScript features.
Array and Object methods
Provides polyfills for modern Array and Object methods like Array.prototype.find and Object.assign, allowing developers to use these methods even in environments that do not natively support them.
[].find(item => item === 2); Object.assign({}, { a: 1 });
Promise support
Includes a polyfill for Promises, enabling asynchronous operations support in environments where Promises are not natively available.
new Promise((resolve, reject) => { resolve('Success'); });
String methods
Adds support for newer String methods such as startsWith and includes, making string manipulation tasks easier and more intuitive.
'hello'.startsWith('he'); 'food'.includes('oo');
Core-js is a modular standard library for JavaScript, providing polyfills for many ECMAScript features. It covers more ground than airbnb-js-shims by including polyfills for features like symbols, sets, and maps. Core-js is often used in environments where a comprehensive set of polyfills is required.
Babel-polyfill (now deprecated in favor of @babel/preset-env) was a package that provided a wider range of JavaScript language features by including core-js and regenerator-runtime. Compared to airbnb-js-shims, babel-polyfill was more focused on supporting the compilation process of modern JavaScript to older versions, making it a more comprehensive solution for developers using Babel.
JS language shims used by Airbnb.
Just require/import airbnb-js-shims
, and the environment will be shimmed.
import 'airbnb-js-shims';
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.
import 'airbnb-js-shims/target/es2015';
airbnb-js-shims/target/es5
(default)airbnb-js-shims/target/es2015
airbnb-js-shims/target/es2016
airbnb-js-shims/target/es2017
airbnb-js-shims/target/es2018
airbnb-js-shims/target/es2019
airbnb-js-shims/target/es2020
FAQs
JS language shims used by Airbnb.
The npm package airbnb-js-shims receives a total of 1,102,902 weekly downloads. As such, airbnb-js-shims popularity was classified as popular.
We found that airbnb-js-shims demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.