Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-function-name

Package Overview
Dependencies
77
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @babel/plugin-transform-function-name

Apply ES2015 function.name semantics to all functions


Version published
Weekly downloads
23M
decreased by-0.47%
Maintainers
4
Install size
2.09 MB
Created
Weekly downloads
 

Package description

What is @babel/plugin-transform-function-name?

The @babel/plugin-transform-function-name package is a plugin for Babel, a JavaScript compiler, that helps in transforming anonymous function expressions into named function expressions. This can be particularly useful for debugging purposes, as it makes stack traces more informative by providing names for otherwise anonymous functions.

What are @babel/plugin-transform-function-name's main functionalities?

Naming anonymous function expressions

Automatically assigns names to anonymous function expressions, making them easier to identify in stack traces and debugging tools.

const square = function(x) { return x * x; }; // Transforms to: const square = function square(x) { return x * x; };

Enhancing debugging

Improves the debugging experience by ensuring that functions are named, which helps in identifying them in call stacks.

let add = function(a, b) { return a + b; }; // Transforms to: let add = function add(a, b) { return a + b; };

Other packages similar to @babel/plugin-transform-function-name

Readme

Source

@babel/plugin-transform-function-name

Apply ES2015 function.name semantics to all functions

Examples

In

let number = (x) => x

Out

var number = function number(x) {
  return x;
};

Installation

npm install --save-dev @babel/plugin-transform-function-name

Usage

.babelrc

{
  "plugins": ["@babel/plugin-transform-function-name"]
}

Via CLI

babel --plugins @babel/plugin-transform-function-name script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-function-name"]
});

Keywords

FAQs

Last updated on 01 Dec 2017

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc