Gathering detailed insights and metrics for @mapbox/hast-util-to-jsx
Gathering detailed insights and metrics for @mapbox/hast-util-to-jsx
Gathering detailed insights and metrics for @mapbox/hast-util-to-jsx
Gathering detailed insights and metrics for @mapbox/hast-util-to-jsx
Transform Markdown into JSX or React component modules
npm install @mapbox/hast-util-to-jsx
Typescript
Module System
Min. Node Version
Node Version
NPM Version
78.5
Supply Chain
80.4
Quality
82.5
Maintenance
100
Vulnerability
100
License
JavaScript (82.51%)
CSS (12.43%)
HTML (4.53%)
Shell (0.53%)
Total Downloads
1,561,293
Last Day
157
Last Week
3,264
Last Month
15,638
Last Year
192,126
MIT License
92 Stars
200 Commits
8 Forks
107 Watchers
3 Branches
605 Contributors
Updated on May 03, 2024
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
@mapbox/hast-util-to-jsx@2.1.0
Unpacked Size
28.56 kB
Size
7.81 kB
File Count
13
NPM Version
9.6.6
Node Version
18.15.0
Published on
Nov 13, 2023
Cumulative downloads
Total Downloads
Last Day
-61.4%
157
Compared to previous day
Last Week
-19.4%
3,264
Compared to previous week
Last Month
1.6%
15,638
Compared to previous month
Last Year
-30.3%
192,126
Compared to previous year
Transform HAST to JSX.
npm install @mapbox/hast-util-to-jsx
1const h = require('hyperscript'); 2const toJsx = require('@mapbox/hast-util-to-jsx'); 3 4const tree = h('div.one.two', id: 'bar' }, [ 5 h('p.hidden', { ariaHidden: true }, ['hidden text']), 6 h('p', { style: 'color: pink; font-size: 2em;' }, ['fancy text']) 7]); 8 9console.log(toJsx(tree));
Yields (with whitespace collapsed):
1<div className="one two" id="bar"> 2 <p className="hidden" aria-hidden={true}>hidden text</p> 3 <p style={{color: "pink", fontSize: "2em"}}>fancy text</p> 4</div>
A few libraries exist to transform HTML to JSX.
Using this util, you can perform that transformation entirely within the ecosystem of unified
syntax trees, using rehype
to parse HTML and this util to stringify the tree into JSX.
hast-util-to-html
— Transform HAST to HTML.rehype
— Process HTML as HAST.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
Found 6/17 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
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