Socket
Socket
Sign inDemoInstall

core-js-pure

Package Overview
Dependencies
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-js-pure

Standard library


Version published
Maintainers
1
Created

What is core-js-pure?

The core-js-pure package is a version of core-js that doesn't pollute the global namespace. It provides polyfills for ECMAScript features, including promises, symbols, collections, iterators, typed arrays, and many other features that are part of the ECMAScript specification but may not be available in all JavaScript environments.

What are core-js-pure's main functionalities?

Polyfilling Promises

This code sample demonstrates how to polyfill Promises using core-js-pure. It allows you to use Promises in environments where they are not natively supported.

import 'core-js-pure/stable/promise';

const promise = Promise.resolve(42);
promise.then(value => console.log(value));

Polyfilling Array methods

This code sample shows how to polyfill Array.prototype.find method. It enables the use of this method in environments where it is not part of the Array prototype.

import 'core-js-pure/stable/array/find';

const array = [1, 2, 3];
const found = array.find(item => item > 1);
console.log(found); // 2

Polyfilling Object static methods

This code sample illustrates how to polyfill Object.assign method. It allows the merging of multiple source objects into a target object in environments that do not support this method natively.

import 'core-js-pure/stable/object/assign';

const target = { a: 1 };
const source = { b: 2 };
const returnedTarget = Object.assign(target, source);

console.log(returnedTarget); // { a: 1, b: 2 }

Polyfilling String methods

This code sample demonstrates how to polyfill String.prototype.includes method. It provides a way to check if one string may be found within another string, returning true or false as appropriate.

import 'core-js-pure/stable/string/includes';

const string = 'hello world';
const includesHello = string.includes('hello');
console.log(includesHello); // true

Other packages similar to core-js-pure

Keywords

FAQs

Package last updated on 26 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc