Gathering detailed insights and metrics for babel-plugin-transform-jsx-to-htm
Gathering detailed insights and metrics for babel-plugin-transform-jsx-to-htm
Gathering detailed insights and metrics for babel-plugin-transform-jsx-to-htm
Gathering detailed insights and metrics for babel-plugin-transform-jsx-to-htm
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
npm install babel-plugin-transform-jsx-to-htm
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
8,889 Stars
409 Commits
176 Forks
71 Watchers
14 Branches
31 Contributors
Updated on Jul 13, 2025
Latest Version
2.2.0
Package Id
babel-plugin-transform-jsx-to-htm@2.2.0
Unpacked Size
9.07 kB
Size
3.11 kB
File Count
3
NPM Version
7.15.1
Node Version
16.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
This plugin converts JSX into Tagged Templates that work with htm.
1// INPUT: 2const Foo = () => <h1>Hello</h1> 3 4// OUTPUT: 5const Foo = () => html`<h1>Hello</h1>`
Grab it from npm:
1npm i -D babel-plugin-transform-jsx-to-htm
... then add it to your Babel config (eg: .babelrc
):
1"plugins": [ 2 "babel-plugin-transform-jsx-to-htm" 3]
The following options are available:
Option | Type | Default | Description |
---|---|---|---|
tag | String | "html" | The "tag" function to prefix [Tagged Templates] with. |
import | false |String|Object | false | Auto-import a tag function, off by default. See Auto-importing a tag function for an example. |
Options are passed to a Babel plugin using a nested Array:
1"plugins": [ 2 ["babel-plugin-transform-jsx-to-htm", { 3 "tag": "$$html" 4 }] 5]
Want to automatically import html
into any file that uses JSX?
Just use the import
option:
1"plugins": [ 2 ["babel-plugin-transform-jsx-to-htm", { 3 "tag": "$$html", 4 "import": { 5 // the module to import: 6 "module": "htm/preact", 7 // a named export to use from that module: 8 "export": "html" 9 } 10 }] 11]
The above will produce files that look like:
1import { html as $$html } from 'htm/preact'; 2 3export default $$html`<h1>hello</h1>`
Apache 2
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 7/15 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More