Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Package created
18 Jul 2013
Version published
20 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does core-js do?

Core-js is a modular standard library for JavaScript. It provides polyfills for ECMAScript, including promises, symbols, collections, iterators, typed arrays and various other features. Core-js also supports ECMAScript proposals and some cross-platform WHATWG / W3C features and proposals, like URL. You can choose to load only the features you need or use it without the pollution of the global namespace.

How do you use core-js?

To use Core-js, you can simply import it into your JavaScript file. Here is an example of using the whole library:

import 'core-js/actual';

Promise.resolve(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]

If you only need certain features, you can import them individually:

import 'core-js/actual/promise';
import 'core-js/actual/iterator';

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

To avoid global namespace pollution, use the 'core-js-pure' import pattern:

import Promise from 'core-js-pure/actual/promise';

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

Where are the core-js docs?

The core-js documentation is available in its GitHub repository. This comprehensive guide provides deeper insights into the package's functionality, usage examples, and additional resources for better understanding and implementation.