Compact mdast Trees

JSON →
library 5.0.0 ·javascript
verified May 27, 2026

mdast-util-compact is a specialized utility within the unified (syntax-tree) ecosystem designed to normalize mdast (Markdown Abstract Syntax Tree) trees by merging adjacent text nodes and collapsing blockquotes. Its primary use case is to clean up an mdast tree after programmatically modifying it, making the tree structure more consistent with how it would be generated by a parser. The current stable version is 5.0.0. The package follows semantic versioning with major releases introducing breaking changes, often related to Node.js version support or ESM migration, as well as updates to underlying `mdast` type definitions. A key differentiator is its explicit recommendation against frequent use, suggesting developers should ideally maintain clean trees themselves rather than relying on this utility post-hoc. It is an ESM-only package and fully typed with TypeScript.

total hits 15
actors 7 distinct systems
last hit 4d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1

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