Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 854,820 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.