Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

core-js-compat

Package Overview
Dependencies
1
Maintainers
1
Versions
115
Issues
File Explorer

Advanced tools

core-js-compat

core-js compat

    3.26.1latest

Version published
Maintainers
1
Weekly downloads
17,500,965
decreased by-10.14%

Weekly downloads

Changelog

Source

3.26.1 - 2022.11.14

  • Disabled forced replacing of Array.fromAsync since it's on Stage 3
  • Avoiding a check of the target in the internal function-uncurry-this helper where it's not required - minor optimization and preventing problems in some broken environments, a workaround of #1141
  • V8 will not ship Array.prototype.{ group, groupToMap } in V8 ~ Chromium 108, proposal-array-grouping/44

Readme

Source

logo

fundraising PRs welcome version core-js-pure downloads

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.

import compat from 'core-js-compat'; const { list, // array of required modules targets, // object with targets for each module } = compat({ targets: '> 1%', // browserslist query or object of minimum environment versions to support, see below modules: [ // optional list / filter of modules - regex, sting or an array of them: 'core-js/actual', // - an entry point 'esnext.array.unique-by', // - a module name (or just a start of a module name) /^web\./, // - regex that a module name must satisfy ], exclude: [ // optional list / filter of modules to exclude, the signature is similar to `modules` option 'web.atob', ], version: '3.26', // used `core-js` version, by default - the latest inverse: false, // inverse of the result - shows modules that are NOT required for the target environment }); console.log(targets); /* => { 'es.error.cause': { ios: '14.5-14.8' }, 'es.aggregate-error.cause': { ios: '14.5-14.8' }, 'es.array.at': { ios: '14.5-14.8' }, 'es.array.find-last': { firefox: '100', ios: '14.5-14.8' }, 'es.array.find-last-index': { firefox: '100', ios: '14.5-14.8' }, 'es.array.includes': { firefox: '100' }, 'es.array.push': { chrome: '100', edge: '101', ios: '14.5-14.8', safari: '15.4' }, 'es.array.unshift': { ios: '14.5-14.8', safari: '15.4' }, 'es.object.has-own': { ios: '14.5-14.8' }, 'es.regexp.flags': { chrome: '100', edge: '101' }, 'es.string.at-alternative': { ios: '14.5-14.8' }, 'es.typed-array.at': { ios: '14.5-14.8' }, 'es.typed-array.find-last': { firefox: '100', ios: '14.5-14.8' }, 'es.typed-array.find-last-index': { firefox: '100', ios: '14.5-14.8' }, 'esnext.array.group': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.group-by': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.group-by-to-map': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.group-to-map': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.to-reversed': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.to-sorted': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.to-spliced': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.unique-by': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.array.with': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.typed-array.to-reversed': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.typed-array.to-sorted': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.typed-array.to-spliced': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'esnext.typed-array.with': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'web.dom-exception.stack': { chrome: '100', edge: '101', ios: '14.5-14.8', safari: '15.4' }, 'web.immediate': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' }, 'web.structured-clone': { chrome: '100', edge: '101', firefox: '100', ios: '14.5-14.8', safari: '15.4' } } */

targets option

targets could be a browserslist query or a targets object that specifies minimum environment versions to support:

// browserslist query: 'defaults, not IE 11, maintained node versions' // object: { android: '4.0', // Android WebView version bun: '0.1.2', // Bun version chrome: '38', // Chrome version deno: '1.12', // Deno version edge: '13', // Edge version electron: '5.0', // Electron framework version firefox: '15', // Firefox version hermes: '0.11', // Hermes version ie: '8', // Internet Explorer version ios: '13.0', // iOS Safari version node: 'current', // NodeJS version, you can use 'current' for set it to currently used oculus: '5.0', // Oculus Browser version opera: '12', // Opera version opera_mobile: '7', // Opera Mobile version phantom: '1.9', // PhantomJS headless browser version rhino: '1.7.13', // Rhino engine version safari: '14.0', // Safari version samsung: '14.0', // Samsung Internet version esmodules: true, // That option set target to minimum supporting ES Modules versions of all browsers browsers: '> 0.25%', // Browserslist query or object with target browsers }

Additional API:

// equals of of the method from the example above require('core-js-compat/compat')({ targets, modules, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } } // or require('core-js-compat').compat({ targets, modules, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } } // full compat data: require('core-js-compat/data'); // => { [ModuleName]: { [EngineName]: EngineVersion } } // or require('core-js-compat').data; // => { [ModuleName]: { [EngineName]: EngineVersion } } // map of modules by `core-js` entry points: require('core-js-compat/entries'); // => { [EntryPoint]: Array<ModuleName> } // or require('core-js-compat').entries; // => { [EntryPoint]: Array<ModuleName> } // full list of modules: require('core-js-compat/modules'); // => Array<ModuleName> // or require('core-js-compat').modules; // => Array<ModuleName> // the subset of modules which available in the passed `core-js` version: require('core-js-compat/get-modules-list-for-target-version')('3.26'); // => Array<ModuleName> // or require('core-js-compat').getModulesListForTargetVersion('3.26'); // => Array<ModuleName>

If you wanna help to improve this data, you could take a look at the related section of CONTRIBUTING.md. The visualization of compatibility data and the browser tests runner is available here, the example:

compat-table

FAQs

What is core-js-compat?

core-js compat

Is core-js-compat popular?

The npm package core-js-compat receives a total of 13,452,495 weekly downloads. As such, core-js-compat popularity was classified as popular.

Is core-js-compat well maintained?

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.

Last updated on 13 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc