安装
npm install core-js-pure
yarn add core-js-pure
pnpm add core-js-pure
bun add core-js-pure
README

logo

fundraising PRs welcome version core-js-pure downloads

I highly recommend reading this: So, what's next?

core-js is a modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2026: 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.

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, Boosty, Bitcoin ( bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz ), Alipay.




Example of usage:

import 'core-js/actual';

Promise.try(() => 42).then(it => console.log(it)); // => 42

Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]

[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]

Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
  .drop(1).take(5)
  .filter(it => it % 2)
  .map(it => it ** 2)
  .toArray(); // => [9, 25]

structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])

You can load only required features:

import 'core-js/actual/promise';
import 'core-js/actual/set';
import 'core-js/actual/iterator';
import 'core-js/actual/array/from';
import 'core-js/actual/array/flat-map';
import 'core-js/actual/structured-clone';

Promise.try(() => 42).then(it => console.log(it)); // => 42

Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]

[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]

Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
  .drop(1).take(5)
  .filter(it => it % 2)
  .map(it => it ** 2)
  .toArray(); // => [9, 25]

structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])

Or use it without global namespace pollution:

import Promise from 'core-js-pure/actual/promise';
import Set from 'core-js-pure/actual/set';
import Iterator from 'core-js-pure/actual/iterator';
import from from 'core-js-pure/actual/array/from';
import flatMap from 'core-js-pure/actual/array/flat-map';
import structuredClone from 'core-js-pure/actual/structured-clone';

Promise.try(() => 42).then(it => console.log(it)); // => 42

from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]

flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]

Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
  .drop(1).take(5)
  .filter(it => it % 2)
  .map(it => it ** 2)
  .toArray(); // => [9, 25]

structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])

It's a version without global namespace pollution (the third example), for more info see core-js documentation.

版本列表
3.49.0 2026-03-16
3.48.0 2026-01-21
3.47.0 2025-11-18
3.46.0 2025-10-09
3.45.1 2025-08-20
3.45.0 2025-08-04
3.44.0 2025-07-07
3.43.0 2025-06-09
3.42.0 2025-04-29
3.41.0 2025-03-01
3.40.0 2025-01-07
3.39.0 2024-10-31
3.38.1 2024-08-20
3.38.0 2024-08-04
3.37.1 2024-05-14
3.37.0 2024-04-16
3.36.1 2024-03-19
3.36.0 2024-02-14
3.35.1 2024-01-20
3.35.0 2023-12-28
3.34.0 2023-12-05
3.33.3 2023-11-19
3.33.2 2023-10-30
3.33.1 2023-10-20
3.33.0 2023-10-01
3.32.2 2023-09-07
3.32.1 2023-08-18
3.32.0 2023-07-27
3.31.1 2023-07-06
3.31.0 2023-06-11
3.30.2 2023-05-06
3.30.1 2023-04-13
3.30.0 2023-04-03
3.29.1 2023-03-13
3.29.0 2023-02-26
3.28.0 2023-02-13
3.27.2 2023-01-18
3.27.1 2022-12-29
3.27.0 2022-12-25
3.26.1 2022-11-13
3.26.0 2022-10-23
3.25.5 2022-10-03
3.25.4 2022-10-02
3.25.3 2022-09-25
3.25.2 2022-09-18
3.25.1 2022-09-07
3.25.0 2022-08-24
3.24.1 2022-07-29
3.24.0 2022-07-25
3.23.5 2022-07-17
3.23.4 2022-07-09
3.23.3 2022-06-25
3.23.2 2022-06-20
3.23.1 2022-06-14
3.23.0 2022-06-13
3.22.8 2022-06-01
3.22.7 2022-05-24
3.22.6 2022-05-22
3.22.5 2022-05-10
3.22.4 2022-05-02
3.22.3 2022-04-28
3.22.2 2022-04-21
3.22.1 2022-04-19
3.22.0 2022-04-15
3.21.1 2022-02-16
3.21.0 2022-02-01
3.20.3 2022-01-15
3.20.2 2022-01-01
3.20.1 2021-12-23
3.20.0 2021-12-15
3.19.3 2021-12-06
3.19.2 2021-11-29
3.19.1 2021-11-02
3.19.0 2021-10-25
3.18.3 2021-10-12
3.18.2 2021-10-05
3.18.1 2021-09-26
3.18.0 2021-09-19
3.17.3 2021-09-09
3.17.2 2021-09-02
3.17.1 2021-09-01
3.17.0 2021-09-01
3.16.4 2021-08-29
3.16.3 2021-08-24
3.16.2 2021-08-17
3.16.1 2021-08-08
3.16.0 2021-07-30
3.15.2 2021-06-29
3.15.1 2021-06-22
3.15.0 2021-06-20
3.14.0 2021-06-05
3.13.1 2021-05-29
3.13.0 2021-05-25
3.12.1 2021-05-08
3.12.0 2021-05-06
3.11.3 2021-05-05
3.11.2 2021-05-03
3.11.1 2021-04-28
3.11.0 2021-04-22
3.10.2 2021-04-19
3.10.1 2021-04-07
3.10.0 2021-03-31
3.9.1 2021-02-28
3.9.0 2021-02-18
3.8.3 2021-01-19
3.8.2 2021-01-03
3.8.1 2020-12-06
3.8.0 2020-11-25
3.7.0 2020-11-06
3.6.5 2020-04-10
3.6.4 2020-01-13
3.6.3 2020-01-10
3.6.2 2020-01-06
3.6.1 2019-12-25
3.6.0 2019-12-18
3.5.0 2019-12-12
3.4.8 2019-12-08
3.4.7 2019-12-02
3.4.6 2019-12-02
3.4.5 2019-11-27
3.4.4 2019-11-27
3.4.3 2019-11-26
3.4.2 2019-11-21
3.4.1 2019-11-12
3.4.0 2019-11-06
3.3.6 2019-10-31
3.3.5 2019-10-28
3.3.4 2019-10-25
3.3.3 2019-10-21
3.3.2 2019-10-14
3.3.1 2019-10-13
3.2.1 2019-08-12
3.2.0 2019-08-08
3.1.4 2019-06-15
3.1.3 2019-05-27
3.1.2 2019-05-21
3.1.1 2019-05-20
3.1.0 2019-05-19
3.0.1 2019-04-06
3.0.0-beta.20 2019-03-17
3.0.0-beta.19 2019-03-14
3.0.0-beta.18 2019-03-09
3.0.0-beta.17 2019-03-09
3.0.0-beta.16 2019-02-18
3.0.0-beta.15 2019-02-09
3.0.0-beta.14 2019-02-07
3.0.0-beta.13 2019-02-04
3.0.0-beta.12 2019-02-02
3.0.0-beta.11 2019-01-27
3.0.0-beta.10 2019-01-22
3.0.0-beta.9 2019-01-17
3.0.0-beta.8 2019-01-10
3.0.0-beta.7 2018-12-27
3.0.0-beta.6 2018-12-18
3.0.0-beta.5 2018-12-11
3.0.0-beta.4 2018-12-04
3.0.0-beta.3 2018-06-07
3.0.0-beta.2 2018-05-26
3.0.0-beta.1 2018-05-19
3.0.0-alpha.4 2018-04-09
3.0.0-alpha.3 2018-03-30
3.0.0-alpha.2 2018-03-27
3.0.0-alpha.1 2018-03-26
3.0.0 2019-03-19
0.0.1 2018-01-03