![Meet Socket at BlackHat and DEF CON in Las Vegas](https://cdn.sanity.io/images/cgdhsj6q/production/4a3876139ffd3878bb3e7800a14cf4044245dca7-1080x834.jpg?w=400&fit=max&auto=format)
Security News
Meet Socket at BlackHat and DEF CON in Las Vegas
Come meet the Socket team at BlackHat and DEF CON! We're sponsoring some fun networking events and we would love to see you there.
core-js-compat
Advanced tools
Package description
The core-js-compat package provides compatibility data for core-js, which is a modular standard library for JavaScript, including polyfills for ECMAScript up to the latest standards. It is useful for developers who need to know which features are available in core-js for a specific version of a browser or Node.js.
Compatibility Data Retrieval
Retrieve a list of features supported by core-js for a specific environment, such as Chrome 70.
const { list } = require('core-js-compat')({ targets: 'chrome 70' });
Custom Build Generation
Generate a list of core-js modules required to support a specific target, such as Internet Explorer 11, with a specific version of core-js.
const { getModulesListForTargetVersion } = require('core-js-compat');
const modulesList = getModulesListForTargetVersion({ targets: { ie: 11 }, version: '3.6' });
Babel-polyfill is a package that includes Babel transforms and a polyfill that includes a custom regenerator runtime and core-js. It is similar to core-js-compat in that it provides polyfills for ECMAScript features, but it is less modular and is deprecated in favor of directly including core-js and regenerator-runtime.
The es6-shim package provides polyfills for ECMAScript 6 (also known as ECMAScript 2015) features. It is similar to core-js-compat in providing polyfills, but it is focused only on ES6 features and does not provide the modular approach or the compatibility data that core-js-compat offers.
The polyfill-service package by Financial Times provides a service that returns a set of polyfills based on the user-agent string of the browser making the request. It is similar to core-js-compat in that it aims to provide polyfills for compatibility, but it does so as a service rather than a package to include in your project.
Changelog
Readme
core-js-compat
package contains data about the necessity of core-js
modules and API for getting a list of required core-js modules by browserslist query.
const {
list, // array of required modules
targets, // object with targets for each module
} = require('core-js-compat')({
targets: '> 2.5%', // browserslist query
filter: /^(es|web)\./, // optional filter - string-prefix, regexp or list of modules
});
console.log(targets);
/* =>
{
'es.symbol.match-all': { ios: '12.2-12.4' },
'es.array.unscopables.flat': { ios: '12.2-12.4' },
'es.array.unscopables.flat-map': { ios: '12.2-12.4' },
'es.math.hypot': { chrome: '77' },
'es.promise.all-settled': { firefox: '69', ios: '12.2-12.4' },
'es.promise.finally': { ios: '12.2-12.4' },
'es.string.match-all': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
'es.string.replace': { firefox: '69', ios: '12.2-12.4' },
'es.typed-array.float32-array': { ios: '12.2-12.4' },
'es.typed-array.float64-array': { ios: '12.2-12.4' },
'es.typed-array.int8-array': { ios: '12.2-12.4' },
'es.typed-array.int16-array': { ios: '12.2-12.4' },
'es.typed-array.int32-array': { ios: '12.2-12.4' },
'es.typed-array.uint8-array': { ios: '12.2-12.4' },
'es.typed-array.uint8-clamped-array': { ios: '12.2-12.4' },
'es.typed-array.uint16-array': { ios: '12.2-12.4' },
'es.typed-array.uint32-array': { ios: '12.2-12.4' },
'es.typed-array.from': { ios: '12.2-12.4' },
'es.typed-array.of': { ios: '12.2-12.4' },
'web.dom-collections.iterator': { ios: '12.2-12.4' },
'web.immediate': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
'web.url': { ios: '12.2-12.4' },
'web.url.to-json': { ios: '12.2-12.4' },
'web.url-search-params': { ios: '12.2-12.4' }
}
*/
If you want to add new / update data about modules required for target engines, follow this instruction.
FAQs
core-js compat
The npm package core-js-compat receives a total of 23,083,228 weekly downloads. As such, core-js-compat popularity was classified as popular.
We found that core-js-compat demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Come meet the Socket team at BlackHat and DEF CON! We're sponsoring some fun networking events and we would love to see you there.
Security News
Learn how Socket's 'Non-Existent Author' alert helps safeguard your dependencies by identifying npm packages published by deleted accounts. This is one of the fastest ways to determine if a package may be abandoned.
Security News
In July, the Python Software Foundation mounted a quick response to address a leaked GitHub token, elected new board members, and added more members to the team supporting PSF and PyPI infrastructure.