
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@mapbox/hast-util-to-jsx
Advanced tools
Transform HAST to JSX.
npm install @mapbox/hast-util-to-jsx
const h = require('hyperscript');
const toJsx = require('@mapbox/hast-util-to-jsx');
const tree = h('div.one.two', id: 'bar' }, [
h('p.hidden', { ariaHidden: true }, ['hidden text']),
h('p', { style: 'color: pink; font-size: 2em;' }, ['fancy text'])
]);
console.log(toJsx(tree));
Yields (with whitespace collapsed):
<div className="one two" id="bar">
<p className="hidden" aria-hidden={true}>hidden text</p>
<p style={{color: "pink", fontSize: "2em"}}>fancy text</p>
</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.FAQs
Transform HAST to JSX
We found that @mapbox/hast-util-to-jsx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.