{"library":"hast-util-to-string","type":"library","category":null,"description":"hast-util-to-string is a utility within the `unified` ecosystem designed to extract the plain-text value of a `hast` (HTML Abstract Syntax Tree) node. It strictly mimics the DOM's `Node#textContent` getter, returning all textual content regardless of styling or layout, and importantly, it does not interpret HTML elements like `<br>` as introducing newlines. This behavior differentiates it from `hast-util-to-text`, which emulates `Node#innerText` by considering rendered output. The current stable version is 3.0.1. As part of the actively maintained `unified` collective, it follows a release cadence tied to the broader ecosystem, with major versions often introducing updated Node.js requirements (e.g., Node.js 16+ for v3) and migrating to modern JavaScript module practices, including being ESM-only and utilizing package `exports` fields. The library provides comprehensive TypeScript type definitions, ensuring robust development.","language":"javascript","status":"active","version":"3.0.1","tags":["javascript","content","hast","hast-util","html","serialize","string","stringify","text","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install hast-util-to-string","imports":["import { toString } from 'hast-util-to-string'","import { toString } from 'hast-util-to-string'","import {toString} from 'https://esm.sh/hast-util-to-string@3'"]},{"cmd":"yarn add hast-util-to-string","imports":[]},{"cmd":"pnpm add hast-util-to-string","imports":[]}],"homepage":null,"github":"https://github.com/rehypejs/rehype-minify.git#main","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hast-util-to-string","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-to-string/compatibility"}}