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
242 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.20.6 (2022-11-28)

:bug: Bug Fix
  • babel-helpers
    • #15231 Update checkInRHS helper min version (@nicolo-ribaudo)

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 28 Nov 2022

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