MCPcopy
hub / github.com/zloirock/core-js

github.com/zloirock/core-js @v3.49.0 sqlite

repository ↗ · DeepWiki ↗ · release v3.49.0 ↗
1,111 symbols 3,044 edges 4,094 files 0 documented · 0%
README

logo

fundraising PRs welcome version core-js downloads core-js-pure downloads

Welcome to our new website, core-js.io, where our documentation is moving!

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

Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2025: 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.

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, 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])

Index

Usage

Installation:

// global version
npm install --save core-js@3.49.0
// version without global namespace pollution
npm install --save core-js-pure@3.49.0
// bundled global version
npm install --save core-js-bundle@3.49.0

postinstall message

The core-js project needs your help, so the package shows a message about it after installation. If it causes problems for you, you can disable it:

ADBLOCK=true npm install
// or
DISABLE_OPENCOLLECTIVE=true npm install
// or
npm install --loglevel silent

CommonJS API

You can import only-required-for-you polyfills, like in the examples at the top of README.md. Available CommonJS entry points for all polyfilled methods / constructors and namespaces. Just some examples:

``ts // polyfill allcore-js` features, including early-stage proposals: import "core-js"; // or: import "core-js/full"; // polyfill all actual features - stable ES, web standards and stage 3 ES proposals: import "core-js/actual"; // polyfill only stable features - ES and web standards: import "core-js/stable"; // polyfill only stable ES features: import "core-js/es";

// if you want to polyfill Set: // all Set-related features, with ea

Core symbols most depended-on inside this repo

load
called by 750
tests/entries/unit.mjs
createIterator
called by 367
tests/helpers/helpers.js
check
called by 189
deno/corejs/index.js
createIterable
called by 143
tests/helpers/helpers.js
at
called by 132
deno/corejs/index.js
toString
called by 111
tests/helpers/helpers.js
superset
called by 94
tests/entries/content.mjs
resolve
called by 85
tests/unit-pure/es.promise.with-resolvers.js

Shape

Function 1,081
Class 20
Method 10

Languages

TypeScript100%

Modules by API surface

deno/corejs/index.js159 symbols
tests/compat/tests.js29 symbols
tests/helpers/qunit-helpers.js20 symbols
tests/helpers/helpers.js20 symbols
website/build.mjs19 symbols
website/scripts/runner.mjs16 symbols
website/scripts/helpers.mjs14 symbols
packages/core-js/modules/web.url.constructor.js14 symbols
packages/core-js/modules/web.structured-clone.js12 symbols
website/src/js/main.js11 symbols
packages/core-js/modules/web.url-search-params.constructor.js10 symbols
packages/core-js/modules/es.symbol.constructor.js10 symbols

Dependencies from manifests, versioned

@babel/cli7.28.6 · 1×
@babel/core7.29.0 · 1×
@babel/plugin-transform-arrow-functions7.27.1 · 1×
@babel/plugin-transform-block-scoped-functions7.27.1 · 1×
@babel/plugin-transform-block-scoping7.28.6 · 1×
@babel/plugin-transform-class-properties7.28.6 · 1×
@babel/plugin-transform-class-static-block7.28.6 · 1×
@babel/plugin-transform-classes7.28.6 · 1×
@babel/plugin-transform-computed-properties7.28.6 · 1×
@babel/plugin-transform-destructuring7.28.5 · 1×
@babel/plugin-transform-duplicate-named-capturing-groups-regex7.29.0 · 1×
@babel/plugin-transform-explicit-resource-management7.28.6 · 1×

For agents

$ claude mcp add core-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact