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

babel-plugin-transform-es2015-block-scoped-functions

Package Overview
Dependencies
Maintainers
6
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-block-scoped-functions

Babel plugin to ensure function declarations at the block level are block scoped

  • 6.22.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
decreased by-31.54%
Maintainers
6
Weekly downloads
 
Created

What is babel-plugin-transform-es2015-block-scoped-functions?

The babel-plugin-transform-es2015-block-scoped-functions package is a Babel plugin that transforms ES2015 block-scoped function declarations into a form that is compatible with older JavaScript environments. This is particularly useful for ensuring that code using block-scoped functions can run in environments that do not natively support ES2015 features.

What are babel-plugin-transform-es2015-block-scoped-functions's main functionalities?

Transform Block-Scoped Functions

This feature transforms block-scoped function declarations into a form that is compatible with older JavaScript environments. In the example, the function `foo` is declared within a block scope, and the plugin ensures that this code can run in environments that do not support block-scoped functions.

const babel = require('@babel/core');
const code = `{
  function foo() { return 'bar'; }
}`;
const output = babel.transform(code, {
  plugins: ['transform-es2015-block-scoped-functions']
});
console.log(output.code);

Other packages similar to babel-plugin-transform-es2015-block-scoped-functions

Keywords

FAQs

Package last updated on 20 Jan 2017

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