Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/runtime

Package Overview
Dependencies
Maintainers
5
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/runtime

babel's modular runtime helpers

  • 7.5.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10M
decreased by-80.4%
Maintainers
5
Weekly downloads
 
Created

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

FAQs

Package last updated on 08 Jul 2019

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