
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
@babel/plugin-transform-destructuring
Advanced tools
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.
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 };
This package offers similar functionality to @babel/plugin-transform-destructuring but is specifically targeted at transforming ES2015 destructuring syntax. It's part of the older Babel 6 ecosystem and has been superseded by the more general @babel/plugin-transform-destructuring in Babel 7.
While not a direct equivalent, babel-preset-env includes @babel/plugin-transform-destructuring among many other plugins. It automatically determines the Babel plugins and polyfills you need based on your supported environments. It's a more comprehensive solution for writing next-gen JavaScript.
Compile ES2015 destructuring to ES5
See our website @babel/plugin-transform-destructuring for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-destructuring
or using yarn:
yarn add @babel/plugin-transform-destructuring --dev
v7.28.0 (2025-07-02)
babel-node
babel-types
babel-compat-data
, babel-preset-env
babel-core
, babel-parser
babel-generator
, babel-parser
babel-plugin-proposal-destructuring-private
, babel-plugin-proposal-do-expressions
, babel-plugin-transform-object-rest-spread
, babel-traverse
, babel-types
babel-parser
, babel-traverse
, babel-types
babel-generator
, babel-plugin-proposal-destructuring-private
, babel-plugin-proposal-discard-binding
, babel-plugin-transform-destructuring
, babel-plugin-transform-explicit-resource-management
, babel-plugin-transform-react-display-name
, babel-types
babel-generator
, babel-parser
, babel-plugin-proposal-destructuring-private
, babel-plugin-transform-block-scoping
, babel-plugin-transform-object-rest-spread
, babel-plugin-transform-typescript
, babel-traverse
, babel-types
babel-helper-globals
, babel-plugin-transform-classes
, babel-traverse
babel-types
babel-compat-data
, babel-plugin-proposal-decorators
, babel-plugin-transform-async-generator-functions
, babel-plugin-transform-json-modules
, babel-plugin-transform-regenerator
, babel-plugin-transform-runtime
, babel-preset-env
, babel-runtime-corejs3
babel-polyfill
packages (@nicolo-ribaudo)FAQs
Compile ES2015 destructuring to ES5
The npm package @babel/plugin-transform-destructuring receives a total of 24,801,278 weekly downloads. As such, @babel/plugin-transform-destructuring popularity was classified as popular.
We found that @babel/plugin-transform-destructuring demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.