unified
Parse, inspect, transform, and serialize content through syntax-tree plugins.
Repository Health
Technical Analysis
unified is the core interface for processing content as structured data using abstract syntax trees. It ties together a parser, a chain of plugin transformers, and a compiler into a single processor, so you can turn text into a tree, manipulate that tree with reusable plugins, and serialize it back out.
As the foundation of the remark (markdown), rehype (HTML), and retext (natural language) ecosystems, unified powers tools like MDX, Gatsby, Docusaurus, and Prettier, and is used in over a million projects on GitHub. You pick and choose plugins to build custom content pipelines without needing to understand the underlying tree formats.
What You Get
- A single
unified()processor factory that chains parse, transform, and stringify phases - A
.use()plugin API for composing reusable transformers and presets - Both async (
process) and sync (processSync) processing, plus lower-levelparse,run, andstringifysteps - Integration with the remark, rehype, and retext ecosystems and 500+ plugins
- First-class TypeScript types for parsers, compilers, plugins, and processors
Common Use Cases
- Building markdown-to-HTML pipelines with remark and rehype plugins
- Linting and transforming prose or documentation as part of a build
- Bridging between content formats (markdown, HTML, natural language) in one workflow
Under The Hood
Architecture — unified’s runtime lives in a single lib/index.js that defines a CallableInstance-based unified function (see lib/callable-instance.js), where each processor is both callable and an object carrying parse, run, stringify, process, and use. Calling a processor clones its frozen configuration into a fresh descendant, so ancestors are never mutated; freeze() seals a processor before export. The three phases — parse (text → tree via a Parser), run (tree → tree via a trough pipeline of Transformers), and stringify (tree → output via a Compiler) — are orchestrated through the trough library, which sequences sync and async transformers and threads a vfile for data, metadata, and messages.
Tech Stack — Pure ESM JavaScript (Node 16+), typed entirely through JSDoc with a hand-written index.d.ts. Runtime dependencies are minimal and focused: trough (middleware pipeline), vfile (virtual file format), bail, extend, is-plain-obj, devlop (dev-only assertions), and @types/unist. Build and quality tooling includes TypeScript project references, tsd for type tests, c8 for 100% coverage enforcement, xo/prettier for linting, and type-coverage pinned at 100%.
Code Quality — Exceptionally rigorous: the test suite under test/ covers every phase and edge case across core.js, freeze.js, parse.js, process.js, run.js, stringify.js, use.js, and more, and CI enforces 100% code coverage and 100% type coverage. Error handling is explicit through bail and vfile messages, naming is consistent, and the public surface is fully documented with inline JSDoc that doubles as the TypeScript API.
API Design — The API is deliberately tiny and highly ergonomic: unified().use(plugin, options).process(file) reads almost like prose, and the same processor exposes lower-level parse/run/stringify for advanced control. Plugins are just functions returning an optional transformer, making the extension model trivial to learn. The extensive readme, worked examples, and precise TypeScript types keep boilerplate near zero, though understanding syntax trees and the plugin lifecycle presents a moderate conceptual learning curve.
Used by 44 apps in this directory
Scalar
Developer Tools
Beautiful, interactive OpenAPI documentation with a built-in offline-first API client and multi-language code generation — all in one open-source platform.
Suna
AI Agents
Turn your company into a git repo — one config, one command center, a workforce of AI agents that runs the real work around the clock.
Supabase
Authentication · Databases · Developer Tools
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
superset
AI Code Assistants · AI Development
Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.
Tabby
AI Code Assistants
Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.
Typebot
AI Assistants · AI Development · Developer Tools
Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.
Unsloth
AI Assistants · AI Development
Run and fine-tune LLMs, diffusion, audio and embedding models on your own hardware, from a native desktop app, a browser UI, or a Python library.
Zulip
Team Chat
Topic-based team chat that brings the structure of email threads to real-time messaging, so distributed teams never lose context across hundreds of concurrent conversations.