core-js

Standard library

core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
Last updated 6 years ago by zloirock .
MIT · Repository · Bugs · Original npm
$ cnpm install core-js 
SYNC missed versions from official npm registry.

logo

Open Collective version core-js downloads core-js-pure downloads tests eslint

Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2021: promises, symbols, collections, iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like URL. You can load only required features or use it without global namespace pollution.

As advertising: the author is looking for a good job -)

core-js@3, babel and a look into the future

Raising funds

core-js isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer if you are interested in core-js: Open Collective, Patreon, Bitcoin ( bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz ).




Example of usage:

import 'core-js/actual'; // <- at the top of your entry point

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, 2, 3, 4, 5].groupBy(it => it % 2);         // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

You can load only required features:

import 'core-js/actual/array/from';       // <- at the top of your entry point
import 'core-js/actual/array/group-by';   // <- at the top of your entry point
import 'core-js/actual/set';              // <- at the top of your entry point
import 'core-js/actual/promise';          // <- at the top of your entry point
import 'core-js/actual/structured-clone'; // <- at the top of your entry point
import 'core-js/actual/queue-microtask';  // <- at the top of your entry point

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, 2, 3, 4, 5].groupBy(it => it % 2);         // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

Or use it without global namespace pollution:

import from from 'core-js-pure/actual/array/from';
import groupBy from 'core-js-pure/actual/array/group-by';
import Set from 'core-js-pure/actual/set';
import Promise from 'core-js-pure/actual/promise';
import structuredClone from 'core-js-pure/actual/structured-clone';
import queueMicrotask from 'core-js-pure/actual/queue-microtask';

from(new Set([1, 2, 3, 2, 1]));                // => [1, 2, 3]
groupBy([1, 2, 3, 4, 5], it => it % 2);        // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

It's a global version (first 2 examples), for more info see core-js documentation.

Current Tags

  • 3.0.0-alpha.4                                ...           alpha (7 years ago)
  • 3.0.0-beta.20                                ...           beta (6 years ago)
  • 3.32.0                                ...           latest (2 years ago)

57 Versions

  • 3.32.0                                ...           2 years ago
  • 3.31.1                                ...           2 years ago
  • 3.30.0                                ...           2 years ago
  • 3.29.1                                ...           2 years ago
  • 3.29.0                                ...           3 years ago
  • 3.28.0                                ...           3 years ago
  • 3.27.0                                ...           3 years ago
  • 3.27.1                                ...           3 years ago
  • 3.26.1                                ...           3 years ago
  • 3.6.1 [deprecated]           ...           6 years ago
  • 3.19.0 [deprecated]           ...           4 years ago
  • 3.26.0                                ...           3 years ago
  • 3.25.3                                ...           3 years ago
  • 3.25.2                                ...           3 years ago
  • 3.24.1                                ...           3 years ago
  • 3.23.5                                ...           3 years ago
  • 3.23.1 [deprecated]           ...           3 years ago
  • 3.23.0 [deprecated]           ...           3 years ago
  • 3.22.8 [deprecated]           ...           3 years ago
  • 3.22.4 [deprecated]           ...           3 years ago
  • 3.22.7 [deprecated]           ...           3 years ago
  • 3.22.5 [deprecated]           ...           3 years ago
  • 3.22.0 [deprecated]           ...           3 years ago
  • 2.6.10 [deprecated]           ...           6 years ago
  • 2.6.9 [deprecated]           ...           6 years ago
  • 3.21.1 [deprecated]           ...           4 years ago
  • 3.20.2 [deprecated]           ...           4 years ago
  • 3.21.0 [deprecated]           ...           4 years ago
  • 3.17.2 [deprecated]           ...           4 years ago
  • 3.20.3 [deprecated]           ...           4 years ago
  • 3.19.1 [deprecated]           ...           4 years ago
  • 3.18.0 [deprecated]           ...           4 years ago
  • 3.17.3 [deprecated]           ...           4 years ago
  • 3.16.1 [deprecated]           ...           4 years ago
  • 3.15.2 [deprecated]           ...           4 years ago
  • 3.14.0 [deprecated]           ...           4 years ago
  • 3.12.1 [deprecated]           ...           4 years ago
  • 3.10.2 [deprecated]           ...           4 years ago
  • 2.5.5 [deprecated]           ...           7 years ago
  • 3.10.1 [deprecated]           ...           4 years ago
  • 2.6.12 [deprecated]           ...           5 years ago
  • 3.9.1 [deprecated]           ...           5 years ago
  • 3.8.3 [deprecated]           ...           5 years ago
  • 3.8.2 [deprecated]           ...           5 years ago
  • 3.0.0-beta.13                                ...           7 years ago
  • 3.2.1                                ...           6 years ago
  • 3.0.0-beta.20                                ...           6 years ago
  • 3.0.0-alpha.4                                ...           7 years ago
  • 3.1.3                                ...           6 years ago
  • 2.5.7 [deprecated]           ...           7 years ago
  • 3.6.4                                ...           6 years ago
  • 2.6.4 [deprecated]           ...           7 years ago
  • 2.4.1 [deprecated]           ...           9 years ago
  • 3.1.4                                ...           6 years ago
  • 1.2.7 [deprecated]           ...           9 years ago
  • 2.6.11 [deprecated]           ...           6 years ago
  • 3.6.5                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org