{"library":"hast-util-excerpt","type":"library","category":null,"description":"hast-util-excerpt is a utility within the unified (specifically hast/rehype) ecosystem designed to truncate an HTML (hast) syntax tree based on an explicit comment marker, typically `<!--more-->`. This allows authors to precisely define where a document's 'excerpt' or 'summary' should end, offering more control than character-count-based truncation methods. The current stable version is 2.0.0, which introduced significant breaking changes by moving to ESM-only and requiring Node.js 16 or newer. Releases occur as changes accumulate, rather than on a fixed schedule. Its primary differentiator is the author-defined explicit truncation point, making it suitable for content management systems or static site generators where content creators need fine-grained control over document summaries. It works by traversing the tree and stopping at the specified comment, returning a modified clone of the original tree.","language":"javascript","status":"active","version":"2.0.0","tags":["javascript","unist","hast","hast-util","util","utility","html","excerpt","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install hast-util-excerpt","imports":["import { excerpt } from 'hast-util-excerpt';","import {excerpt} from 'https://esm.sh/hast-util-excerpt@2'"]},{"cmd":"yarn add hast-util-excerpt","imports":[]},{"cmd":"pnpm add hast-util-excerpt","imports":[]}],"homepage":null,"github":"https://github.com/syntax-tree/hast-util-excerpt","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hast-util-excerpt","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-excerpt/compatibility"}}