You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@babel/helper-module-transforms

Package Overview
Dependencies
Maintainers
4
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-module-transforms

Babel helper functions for implementing ES6 module transformations


Version published
Weekly downloads
41M
decreased by-1.12%
Maintainers
4
Install size
6.27 MB
Created
Weekly downloads
 

Package description

What is @babel/helper-module-transforms?

The @babel/helper-module-transforms package is part of the Babel toolchain, designed to assist in the transformation of ECMAScript modules. It provides utility functions and helpers that facilitate the conversion of ES6 module syntax (import/export) to various module systems (like CommonJS, AMD, UMD, etc.) that are compatible with different environments and bundlers. This package is mainly used internally by Babel plugins to abstract and simplify the handling of module transformations.

What are @babel/helper-module-transforms's main functionalities?

Transform ES6 import/export to CommonJS

This feature allows the transformation of ES6 module syntax into CommonJS syntax, enabling compatibility with environments that support CommonJS modules. The code sample demonstrates how an ES6 import statement is transformed into a CommonJS require call.

"use strict";\n\nvar _foo = require("foo");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _foo2 = _interopRequireDefault(_foo);\n\nconsole.log(_foo2.default);

Interoperability with default and named exports

Ensures interoperability between ES6 modules and CommonJS by handling default and named exports. The code sample shows how a default export in ES6 is transformed to be compatible with CommonJS, including the use of Object.defineProperty to simulate ES6 export behavior.

"use strict";\n\nObject.defineProperty(exports, "__esModule", {\n  value: true\n});\nexports.default = void 0;\nvar _default = 'Hello, world!';\nexports.default = _default;

Other packages similar to @babel/helper-module-transforms

Changelog

Source

v7.24.8 (2024-07-11)

:eyeglasses: Spec Compliance
  • babel-parser
    • #16567 Do not use strict mode in TS declare (@liuxingbaoyu)
:bug: Bug Fix
:nail_care: Polish

Readme

Source

@babel/helper-module-transforms

Babel helper functions for implementing ES6 module transformations

See our website @babel/helper-module-transforms for more information.

Install

Using npm:

npm install --save @babel/helper-module-transforms

or using yarn:

yarn add @babel/helper-module-transforms

FAQs

Package last updated on 11 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc