Skip to content

core-js

A JavaScript library that adds missing modern language features to older browsers and engines.

Stars
25.5k
Forks
1.7k
Licence
MIT
Language
JavaScript
Last update
4 days ago
Type
Library

What it is

core-js is a JavaScript library that provides polyfills, which are code pieces that add newer standard features (such as Promises, Symbols, collections, iterators, and typed arrays) to environments that do not support them yet. It also includes some web standard features like URL. You can load only the features you need, or use it in a way that does not add anything to the global namespace.

  • Use Promise.try, Set.prototype.union, Array flatMap, and structuredClone in code that must run on older engines
  • Import only the specific polyfills a project needs to keep bundle size down
  • Use the core-js-pure package to access modern built-ins without modifying global objects
  • Let Babel's preset-env add the required polyfills automatically based on your target browsers

Great for

  • Web developers who must support older browsers or engines that lack modern JavaScript features
  • Teams using Babel or swc who want standard library polyfills handled through their build setup
  • Library authors who want to use newer built-ins without changing global objects, via the core-js-pure variant
  • Developers who want fine-grained control by importing only specific features

Not ideal for

  • Projects that only target modern evergreen browsers and do not need polyfills, since the extra code adds weight without benefit
  • People looking for an end-user application; this is a code library with no interface
  • Developers who need a fully documented single-page guide in the README alone, since the README points to core-js.io for the main documentation
Step-by-step guide: how to use core-jsInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js or a JavaScript bundler setup (the README mentions npm packages)

    Install core-js from npm

    npm install core-js@3
  2. 2

    Run it

    • Install the package with npm.
    • Import the feature you need, for example import 'core-js/actual/promise';
    • Or import the full bundle with import 'core-js/actual';
    • Run your code in the target environment to confirm the polyfilled features work.
  3. 3

    Get the most out of it

    • Use core-js-pure with imports like core-js-pure/actual/set to avoid changing global objects.
    • Combine with Babel's preset-env and the babel-plugin-polyfill-corejs3 plugin to add only needed polyfills automatically.
    • Load only the feature paths you use, such as core-js/actual/array/from, to reduce bundle size.
    • Check the documentation at core-js.io for the compatibility data and supported engines list.

Downloads

Strengths

  • Covers a broad range of ECMAScript features, including proposals, according to the README
  • Offers both global polyfills and a namespace-safe pure variant
  • Used widely and actively maintained, with a recent release and push date

Trade-offs

  • Adds code to your bundle, so you need to choose what to load to avoid unnecessary size
  • The README is truncated here, so detailed setup and configuration are only partly visible and mostly live on the external documentation site
  • Funding is informal (donations and sponsorships) rather than backed by a company, which the README itself notes affects its future

How it compares

ProjectStarsTypeLevelUpdatedBest for
core-js (this)25.5kLibraryintermediate4 days agoWeb developers who must support older browsers or engines that lack modern JavaScript features
babel44.1kDev toolintermediate4 days agoWeb developers who want to use recent JavaScript syntax while still supporting older browsers
x-spreadsheet14.6kLibraryintermediate2.2 years agoWeb developers who want a spreadsheet-style editor inside their own app
javascript148kLearning resourcebeginner7 months agoTeams that want one shared JavaScript style without debating every rule
tiptap38.9kLibraryintermediate4 days agoDevelopers building a custom text editor into a web product
parcel44kDev toolbeginner4 days agoWeb developers who want a bundler that works without a config file

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.