core-js
    Overview
    Documentation
    Tutorials
    Chat
    Insights
    Code
    Dependencies
    Contributors
    Jobs

core-js

Standard library

3.2.1  •  Updated 9 months ago  •  by Denis Pushkarev  •  MIT License

Sponsors on Open Collective Backers on Open Collective Gitter version npm downloads Build Status devDependency status

Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2019: 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 on Open Collective or on Patreon if you are interested in core-js.




Example:

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

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, [2, 3], [4, [5]]].flat(2);                 // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32

You can load only required features:

import 'core-js/features/array/from'; // <- at the top of your entry point
import 'core-js/features/array/flat'; // <- at the top of your entry point
import 'core-js/features/set';        // <- at the top of your entry point
import 'core-js/features/promise';    // <- at the top of your entry point

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, [2, 3], [4, [5]]].flat(2);                 // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32

Or use it without global namespace pollution:

import from from 'core-js-pure/features/array/from';
import flat from 'core-js-pure/features/array/flat';
import Set from 'core-js-pure/features/set';
import Promise from 'core-js-pure/features/promise';

from(new Set([1, 2, 3, 2, 1]));                // => [1, 2, 3]
flat([1, [2, 3], [4, [5]]], 2);                // => [1, 2, 3, 4, 5]
Promise.resolve(32).then(x => console.log(x)); // => 32

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

Popularity

Weekly Downloads
Add this graph to GitHub
18.9M

Maintenance

Development

Last ver 9 months ago
Created 7 years ago
Last commit 1 month ago
18 hours between commits

Technology

Node version: 12.4.0
571.7K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

43 contributors
Denis Pushkarev
Maintainer, 926 commits, 114 merges, 17 PRs
Works at Looking for a good job -)
Sch
Maintainer, 21 commits, 12 merges, 9 PRs
Nicolò Ribaudo
18 commits, 12 PRs
Works at babel
Nick Etson
5 commits, 3 PRs
Chi Vinh Le
5 commits, 1 PRs
Scott Arciszewski
4 commits, 4 PRs
Works at aws

Dependencies

Tags

ES3
ES5
ES6
ES7
ES2015
ES2016
ES2017
ES2018
ES2019
ECMAScript 3
ECMAScript 5
ECMAScript 6
ECMAScript 7
ECMAScript 2015
ECMAScript 2016
ECMAScript 2017
ECMAScript 2018
ECMAScript 2019
Harmony
Strawman
Map
Set
WeakMap
WeakSet
Promise
Observable
Symbol
TypedArray
URL
URLSearchParams
queueMicrotask
setImmediate
polyfill
ponyfill
shim
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.