Socket
Socket
Sign inDemoInstall

babel-plugin-strve

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-strve

A Babel plugin that compiles the template string in Strve.js into a normal object.


Version published
Weekly downloads
10
increased by400%
Maintainers
1
Install size
21.3 kB
Created
Weekly downloads
 

Readme

Source

babel-plugin-strve

A Babel plugin that compiles the template string in Strve.js into a normal object.

Usage

In your Babel configuration (.babelrc, babel.config.js, "babel" field in package.json, etc), add the plugin:

{
  "plugins": [
    ["babel-plugin-strve"]
  ]
}

options

tag=html

By default, babel-plugin-strve will process all Tagged Templates with a tag function named html. To use a different name, use the tag option in your Babel configuration:

{"plugins":[
  ["babel-plugin-strve", {
    "tag": "html"
  }]
]}

other modes

By default, html`` will be used as a tag template mode. If there are other scenarios, you can choose to call the expression mode, there are two.

  1. The function name is tem_h, and the parameter is a template string.
tem_h(`<p>hello</p>`);
  1. The function name is str_h, and the parameters are ordinary strings.
str_h("<p>hello</p>");

Whether you choose the default mode or call the expression mode, their final output structure is the same. In addition, these modes we can use at the same time.

License

MIT

Copyright (c) 2022-present, maomincoding

Keywords

FAQs

Last updated on 23 Nov 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc