hast to DOM Transformer

JSON →
library 4.0.1 ·javascript
verified May 27, 2026

This package, `hast-util-to-dom`, serves as a utility for converting a `hast` (HTML Abstract Syntax Tree) into a browser-native DOM tree or a simulated DOM environment like `jsdom`. The current stable version is 4.0.1. The project generally follows Node.js maintenance cycles for compatibility, dropping support for unmaintained Node.js versions with major releases. It has a steady release cadence, with version 4.0.0 released recently to update dependencies and enforce modern JavaScript environments. Key differentiators include its tight integration within the unified ecosystem, providing a direct transformation path for HTML ASTs to DOM nodes. It supports client-side rendering directly into the browser's DOM, and also works in server-side contexts with DOM implementations like `jsdom`. It complements `hast-util-from-dom`, which performs the inverse operation, turning DOM trees into hast. Furthermore, `hast-util-to-dom` is utilized internally by `rehype-dom-stringify` for DOM-based HTML serialization. It is important to note that the library transitioned to being ESM-only since version 3.0.0 and requires Node.js 16 or newer as of version 4.0.0, which are significant compatibility considerations for integrators.

total hits 14
actors 6 distinct systems
last hit 1d ago Bingbot
MetaBot
4
GPTBot
2
Script
1
Search engines
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇳🇴 Norway · 🇩🇪 Germany