Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@babel/plugin-transform-modules-umd
Advanced tools
This plugin transforms ES2015 modules to UMD
The @babel/plugin-transform-modules-umd package is a Babel plugin that transforms ES2015 modules to UMD (Universal Module Definition) format. This allows the modules to be used in various environments, such as in the browser, Node.js, or AMD (Asynchronous Module Definition) environments. The plugin provides flexibility in module usage across different platforms by wrapping the code in a UMD wrapper.
Transform ES2015 modules to UMD
This feature allows developers to write their JavaScript modules using the modern ES2015 module syntax and then transform them into UMD format. The transformed code can be executed in various environments without modification. The code sample shows a simple module exporting a string, transformed into UMD format.
"use strict";\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nexports.default = void 0;\n\nvar _default = 'Hello World';\n\nexports.default = _default;\nmodule.exports = exports["default"];
Similar to @babel/plugin-transform-modules-umd, this package transforms ES2015 modules to AMD (Asynchronous Module Definition) format. While @babel/plugin-transform-modules-umd targets multiple environments, @babel/plugin-transform-modules-amd specifically targets AMD-compatible loaders.
This package transforms ES2015 modules to CommonJS format, making them suitable for use in Node.js environments. It is similar to @babel/plugin-transform-modules-umd in that it deals with module transformation, but it focuses on CommonJS format instead of UMD.
This Babel plugin transforms ES2015 modules to SystemJS format, a dynamic module loader that can load modules in multiple formats. It is similar to @babel/plugin-transform-modules-umd in its goal to make modules usable in different environments, but it specifically targets SystemJS-compatible environments.
This plugin transforms ES2015 modules to UMD
See our website @babel/plugin-transform-modules-umd for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-modules-umd
or using yarn:
yarn add @babel/plugin-transform-modules-umd --dev
v7.25.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
This plugin transforms ES2015 modules to UMD
We found that @babel/plugin-transform-modules-umd 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.