{"library":"hast-util-from-string","type":"library","category":null,"description":"hast-util-from-string is a utility package within the unified and rehype ecosystem designed to efficiently set the plain-text value of a HAST (Hypertext Abstract Syntax Tree) node. It mimics the behavior of the DOM's `Node#textContent` setter, effectively replacing all children of a node with a single text node containing the provided string value. The current stable version is 3.0.1. As part of the unified collective, it follows a coordinated release cadence, often aligning major version bumps across related packages, though individual utilities receive minor and patch updates as needed. A key differentiator is its `textContent`-like behavior, contrasting with `hast-util-from-text` which emulates `innerText` and considers rendering specifics like line breaks and table cell separation. The library is ESM-only and fully typed with TypeScript.","language":"javascript","status":"active","version":"3.0.1","tags":["javascript","content","hast","hast-util","html","string","text","unist","util","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install hast-util-from-string","imports":["import { fromString } from 'hast-util-from-string'","import {fromString} from 'https://esm.sh/hast-util-from-string@3'","<script type=\"module\"> import {fromString} from 'https://esm.sh/hast-util-from-string@3?bundle' </script>"]},{"cmd":"yarn add hast-util-from-string","imports":[]},{"cmd":"pnpm add hast-util-from-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-from-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-from-string/compatibility"}}