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

@babel/plugin-transform-destructuring

Package Overview
Dependencies
Maintainers
4
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-destructuring

Compile ES2015 destructuring to ES5

  • 8.0.0-alpha.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19M
decreased by-28.18%
Maintainers
4
Weekly downloads
 
Created

What is @babel/plugin-transform-destructuring?

The @babel/plugin-transform-destructuring npm package is a plugin for Babel, a JavaScript compiler, that enables the transformation of destructuring assignments and rest properties in JavaScript code. This allows for more concise and readable code, especially when dealing with objects or arrays. The plugin is part of the larger Babel ecosystem, which helps developers write next-gen JavaScript today.

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

Object Destructuring

Transforms object destructuring syntax into a format that can be understood by environments that do not support ES2015 or later. This feature allows for extracting properties from objects and assigning them to variables in a single statement.

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

Array Destructuring

Enables transformation of array destructuring, which allows for a similar concise syntax for arrays as for objects, extracting values from arrays directly into variables.

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

Nested Destructuring

Supports nested destructuring, which is useful for extracting deeply nested properties or values from objects or arrays into variables at various levels of depth.

const { a: { b, c } } = { a: { b: 1, c: 2 } };

Default Values

Allows for setting default values in destructuring assignments, which is particularly useful when the expected property might not exist in the source object or array.

const { a = 10, b = 5 } = { a: 3 };

Other packages similar to @babel/plugin-transform-destructuring

Keywords

FAQs

Package last updated on 26 Jul 2024

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