Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zloirock/core-js/llms.txt
Use this file to discover all available pages before exploring further.
core-js-pure provides the same polyfills as core-js but does not modify native globals. Instead, each feature is a standalone export. This makes it safe to use in published libraries where mutating globals would affect the host application.
Installation
Usage
Named imports
Import the polyfilled version of any built-in directly. The import returns the polyfilled implementation regardless of what the native environment provides.Entry namespaces
The same namespaces available incore-js work identically in core-js-pure:
| Namespace | Import path | What it includes |
|---|---|---|
full | core-js-pure/full/… | Everything including early-stage proposals |
actual | core-js-pure/actual/… | Stable ES, web standards, stage 3+ proposals — recommended |
stable | core-js-pure/stable/… | Stable ES and web standards only |
es | core-js-pure/es/… | Stable ECMAScript features only |
Per-method imports
Prototype methods as static functions
Becausecore-js-pure cannot patch prototypes, prototype methods are re-exported as static functions. You call them with the instance as the first argument instead of using dot syntax.
Virtual methods with the bind operator
With transpilers that support the bind operator proposal,core-js-pure ships /virtual/ entry points that restore method-call syntax without touching the prototype:
Automatic injection with @babel/runtime
@babel/runtime with corejs: 3 can replace modern JS usage with core-js-pure imports automatically, so you write idiomatic JS and get pollution-free polyfills for free:
When to use core-js-pure
Use core-js-pure when...
- Authoring a library or npm package
- You cannot control the host application’s globals
- You need explicit, auditable imports
- You want zero side effects from your package
Use core-js instead when...
- Building an end-user application
- You want transparent patching of native globals
- You use Babel/swc auto-injection via
useBuiltIns - Prototype method syntax (
.findLast()) is preferred