Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@babel/runtime-corejs2
Advanced tools
@babel/runtime-corejs2 is a library that provides a runtime for Babel that includes polyfills for ECMAScript features using core-js@2. It helps to avoid code duplication and reduce the size of the compiled code by providing helpers and polyfills as separate modules.
Polyfilling ECMAScript features
This feature allows you to polyfill ECMAScript features like Map and Set, ensuring compatibility with older environments that do not support these features natively.
import 'core-js/es6/map';
import 'core-js/es6/set';
const map = new Map();
const set = new Set();
Helper functions
This feature provides helper functions like classCallCheck to ensure that classes are instantiated correctly, which is useful for maintaining compatibility with older JavaScript environments.
import _classCallCheck from '@babel/runtime-corejs2/helpers/classCallCheck';
class MyClass {
constructor() {
_classCallCheck(this, MyClass);
}
}
Async/Await support
This feature provides support for async/await syntax by transforming it into generator functions, which are compatible with older JavaScript environments.
import _asyncToGenerator from '@babel/runtime-corejs2/helpers/asyncToGenerator';
import regeneratorRuntime from 'regenerator-runtime';
const asyncFunction = _asyncToGenerator(function* () {
const result = yield fetch('https://api.example.com/data');
return result.json();
});
asyncFunction().then(data => console.log(data));
@babel/runtime is a similar package that provides the same runtime helpers and polyfills but uses core-js@3 instead of core-js@2. It is more up-to-date and recommended for new projects.
core-js is a modular standard library for JavaScript that includes polyfills for ECMAScript features. It can be used directly to polyfill features without relying on Babel's runtime.
regenerator-runtime is a runtime library for transforming generator functions and async/await syntax. It is often used in conjunction with Babel to provide support for these features in older environments.
babel's modular runtime helpers with core-js@2 polyfilling
See our website @babel/runtime-corejs2 for more information.
Using npm:
npm install --save @babel/runtime-corejs2
or using yarn:
yarn add @babel/runtime-corejs2
v7.25.0 (2024-07-26)
babel-helpers
, babel-plugin-proposal-explicit-resource-management
, babel-runtime-corejs3
babel-plugin-transform-typescript
babel-helper-create-class-features-plugin
, babel-helper-function-name
, babel-helper-plugin-utils
, babel-helper-wrap-function
, babel-plugin-bugfix-safari-class-field-initializer-scope
, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression
, babel-plugin-transform-classes
, babel-plugin-transform-function-name
, babel-preset-env
, babel-traverse
, babel-types
ensureFunctionName
to NodePath.prototype
(@nicolo-ribaudo)babel-helper-hoist-variables
, babel-helper-plugin-utils
, babel-plugin-proposal-async-do-expressions
, babel-plugin-transform-modules-systemjs
, babel-traverse
hoistVariables
to Scope.prototype
(@nicolo-ribaudo)babel-helper-create-class-features-plugin
, babel-helper-module-transforms
, babel-helper-plugin-utils
, babel-helper-split-export-declaration
, babel-plugin-transform-classes
, babel-traverse
, babel-types
splitExportDeclaration
to NodePath.prototype
(@nicolo-ribaudo)babel-helper-create-class-features-plugin
, babel-helper-environment-visitor
, babel-helper-module-transforms
, babel-helper-plugin-utils
, babel-helper-remap-async-to-generator
, babel-helper-replace-supers
, babel-plugin-bugfix-firefox-class-in-computed-class-key
, babel-plugin-bugfix-v8-static-class-fields-redefine-readonly
, babel-plugin-transform-async-generator-functions
, babel-plugin-transform-classes
, babel-traverse
environment-visitor
helper into @babel/traverse
(@nicolo-ribaudo)babel-core
, babel-parser
.extra.async
(@nicolo-ribaudo)babel-compat-data
, babel-plugin-bugfix-safari-class-field-initializer-scope
, babel-preset-env
bugfix-safari-class-field-initializer-scope
(@davidtaylorhq)babel-plugin-transform-block-scoping
, babel-traverse
, babel-types
babel-helper-import-to-platform-api
, babel-plugin-proposal-json-modules
uncheckedRequire
option for JSON imports to CJS (@nicolo-ribaudo)babel-helper-transform-fixture-test-runner
, babel-node
babel-node --eval
(@slatereax)babel-compat-data
, babel-helper-create-regexp-features-plugin
, babel-plugin-proposal-duplicate-named-capturing-groups-regex
, babel-plugin-transform-duplicate-named-capturing-groups-regex
, babel-preset-env
, babel-standalone
babel-generator
babel-template
, babel-types
babel-generator
(
before ambiguous tokens (@nicolo-ribaudo)babel-helper-function-name
, babel-plugin-transform-arrow-functions
, babel-plugin-transform-function-name
, babel-preset-env
, babel-traverse
helper-function-name
logic (@nicolo-ribaudo)babel-parser
, babel-plugin-proposal-pipeline-operator
babel-plugin-transform-classes
assertThisInitialized
(@liuxingbaoyu)babel-helper-create-class-features-plugin
, babel-helper-replace-supers
, babel-helpers
, babel-plugin-proposal-decorators
, babel-plugin-transform-class-properties
, babel-plugin-transform-classes
, babel-plugin-transform-exponentiation-operator
, babel-plugin-transform-object-super
, babel-plugin-transform-private-methods
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
super.x
output (@liuxingbaoyu)babel-plugin-transform-class-properties
, babel-plugin-transform-classes
FAQs
babel's modular runtime helpers with core-js@2 polyfilling
The npm package @babel/runtime-corejs2 receives a total of 418,235 weekly downloads. As such, @babel/runtime-corejs2 popularity was classified as popular.
We found that @babel/runtime-corejs2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.