🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

rehype-parse-isomorphic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-parse-isomorphic

A module that exports rehype-parse for Node.js and rehype-dom-parse for the browser.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

rehype-parse-isomorphic

version CI
A module that exports rehype-parse for Node.js and rehype-dom-parse for the browser.

Install

$ npm i rehype-parse-isomorphic

Usage

Use just like rehype-parse and rehype-dom-parse.

[!WARNING]

The two libraries do not have exactly the same options. Make sure you account for the differences when the library is used in Node.js vs the browser.

Why?

It's better to use rehype-dom-parse than rehype-parse in the browser because the former has a significantly smaller bundle size (~8 kB vs ~63 kB).

Typically it's possible to just import rehype-parse in Node.js and rehype-dom-parse in the browser, but not always. Sometimes you want to parse HTML in code that can be used in either the browser or Node.js (i.e. in isomorphic code). Which library would you import in that code?

Without this module you'd be forced to import the lowest common denominator, the library that works in both Node.js and the browser, which would be rehype-parse. And now your browser JavaScript bundle is ~55 kB bigger than it should have been! With this module, you use the right library in each environment.

Contributing

Stars are always welcome!

For bugs and feature requests, please create an issue.

License

MIT © Tomer Aberbach
Apache 2.0 © Google

Keywords

ast

FAQs

Package last updated on 01 Sep 2025

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