Socket
Socket
Sign inDemoInstall

babel-plugin-transform-es2015-destructuring

Package Overview
Dependencies
1
Maintainers
6
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-es2015-destructuring


Version published
Weekly downloads
1.1M
decreased by-21.61%
Maintainers
6
Created
Weekly downloads
 

Package description

What is babel-plugin-transform-es2015-destructuring?

The babel-plugin-transform-es2015-destructuring package is a Babel plugin that transforms ES2015 destructuring syntax into ES5 code. This allows developers to use modern JavaScript destructuring features while maintaining compatibility with older JavaScript environments.

What are babel-plugin-transform-es2015-destructuring's main functionalities?

Array Destructuring

Transforms array destructuring syntax into ES5 code. This allows you to extract values from arrays and assign them to variables in a concise manner.

const [a, b] = [1, 2];

Object Destructuring

Transforms object destructuring syntax into ES5 code. This allows you to extract properties from objects and assign them to variables in a concise manner.

const { x, y } = { x: 1, y: 2 };

Nested Destructuring

Transforms nested destructuring syntax into ES5 code. This allows you to extract nested properties from objects and assign them to variables.

const { a: { b } } = { a: { b: 1 } };

Default Values

Transforms destructuring with default values into ES5 code. This allows you to assign default values to variables if the property is undefined.

const { a = 10 } = {};

Other packages similar to babel-plugin-transform-es2015-destructuring

Readme

Source

babel-plugin-transform-es2015-destructuring

Compile ES2015 destructuring to ES5

Installation

$ npm install babel-plugin-transform-es2015-destructuring

Usage

.babelrc

{
  "plugins": ["transform-es2015-destructuring"]
}

Via CLI

$ babel --plugins transform-es2015-destructuring script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-destructuring"]
});

Keywords

FAQs

Last updated on 24 Oct 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc