{"library":"hast-util-from-dom","type":"library","category":null,"description":"hast-util-from-dom is a utility package designed to convert a DOM tree (either from a browser's native DOM or headless environments like JSDOM) into a HAST (Hypertext Abstract Syntax Tree) HTML syntax tree. It is part of the unified ecosystem for processing text. The current stable version is 5.0.1, which is ESM-only and requires Node.js 16 or newer. It typically follows the release cadence of the wider unified ecosystem. Key differentiators include its small size, primary suitability for browser environments, and its explicit choice *not* to provide positional information, which distinguishes it from more comprehensive parsing solutions. It serves as the inverse to `hast-util-to-dom` and is wrapped by `rehype-dom-parse` for HTML parsing with DOM APIs. While efficient for its purpose, users should be aware that it might yield varying results in different or older browsers.","language":"javascript","status":"active","version":"5.0.1","tags":["javascript","dom","hast-util","hast","html","rehype","unist","utility","util","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install hast-util-from-dom","imports":["import { fromDom } from 'hast-util-from-dom'","import type { Options } from 'hast-util-from-dom'","import type { AfterTransform } from 'hast-util-from-dom'"]},{"cmd":"yarn add hast-util-from-dom","imports":[]},{"cmd":"pnpm add hast-util-from-dom","imports":[]}],"homepage":null,"github":"https://github.com/syntax-tree/hast-util-from-dom","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hast-util-from-dom","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/hast-util-from-dom/compatibility"}}