Socket
Socket
Sign inDemoInstall

@babel/runtime

Package Overview
Dependencies
1
Maintainers
4
Versions
158
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/runtime

babel's modular runtime helpers


Version published
Maintainers
4
Weekly downloads
42,932,354
decreased by-17.73%
Install size
283 kB

Weekly downloads

Package description

What is @babel/runtime?

The @babel/runtime package is a library that includes Babel modular runtime helpers and a version of regenerator-runtime. It is used to avoid polluting the global scope and to reduce the size of the compiled output by deduplicating helper functions that are commonly used by Babel-transpiled code. It is particularly useful when building libraries or applications that need to be optimized for size and scope isolation.

What are @babel/runtime's main functionalities?

Modularized Helpers

This feature allows you to use Babel's helper functions in a modular way, without including them in every file that needs them, thus reducing redundancy and file size.

import _classCallCheck from '@babel/runtime/helpers/classCallCheck';

class MyClass {
  constructor() {
    _classCallCheck(this, MyClass);
    // class body
  }
}

Regenerator Runtime

Includes a version of the regenerator runtime to enable the use of async/await and generator functions in environments that do not natively support them.

import 'regenerator-runtime/runtime';

async function asyncCall() {
  await someAsyncFunction();
}

Other packages similar to @babel/runtime

Changelog

Source

v7.24.4 (2024-04-03)

:eyeglasses: Spec Compliance
  • babel-parser
    • #16403 Forbid initializerless using (@JLHwung)
  • babel-helpers, babel-plugin-proposal-decorators, babel-runtime-corejs3
:bug: Bug Fix
  • babel-generator
  • babel-compat-data, babel-plugin-bugfix-firefox-class-in-computed-class-key, babel-preset-env
  • babel-helper-create-class-features-plugin, babel-plugin-proposal-decorators
  • babel-plugin-transform-block-scoping
  • babel-core, babel-plugin-transform-block-scoped-functions, babel-plugin-transform-block-scoping

Readme

Source

@babel/runtime

babel's modular runtime helpers

See our website @babel/runtime for more information.

Install

Using npm:

npm install --save @babel/runtime

or using yarn:

yarn add @babel/runtime

FAQs

Last updated on 03 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc