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

babel-plugin-macros

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-macros

Allows you to build compile-time libraries

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15M
decreased by-8.91%
Maintainers
1
Weekly downloads
ย 
Created

What is babel-plugin-macros?

babel-plugin-macros allows you to build simple compile-time libraries that can be used to perform various transformations on your code during the build process. It enables you to write code that gets expanded or transformed at compile-time, which can be useful for a variety of tasks such as code generation, optimizations, or embedding additional information into your code.

What are babel-plugin-macros's main functionalities?

Tagged Template Literal Transformation

Transform tagged template literals using custom logic defined in a macro. This can be used to process or manipulate strings at compile time.

`import myMacro from './macros/myMacro';\nconst result = myMacro\
  \`Some template literal content\
  \`;`

Function Call Transformation

Transform function calls with a macro to inline computed values or perform compile-time checks.

`import myMacro from './macros/myMacro';\nconst result = myMacro({ some: 'data' });`

Import Statement Transformation

Customize how import statements are handled, potentially inlining code or generating additional code based on the import.

`import { myFeature } from './macros/myMacro';`

Other packages similar to babel-plugin-macros

Keywords

FAQs

Package last updated on 05 May 2021

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