What is unifast?

unifast is a high-performance Markdown and MDX compiler with a Rust core. Built-in passes for GFM, sanitization, highlighting, and TOC.

unifast is a high-performance Markdown and MDX compiler with a Rust core. It covers the mainstream use-cases of remark/rehype by implementing features directly as built-in passes - not through JS plugin compatibility.

Why unifast?

Traditional Markdown toolchains like unified/remark/rehype are powerful but come with trade-offs:

  • Performance overhead - Multiple JS AST transformations add up, especially at scale.

  • Plugin coordination - Ordering, compatibility, and duplication across dozens of plugins.

  • No built-in features - Even basic tasks like GFM or sanitization require separate packages.

unifast takes a different approach:

  • Rust core - Parsing, transformation, and emission all happen in native code.

  • Built-in passes - Common features (GFM, sanitization, highlighting, TOC) are built-in, not bolted on.

  • Single compilation - One call compiles Markdown to HTML with all features applied.

Key Features

FeatureDescription
CommonMark + GFMTables, task lists, strikethrough, autolinks, footnotes
FrontmatterYAML, TOML, and JSON metadata extraction
MDXJSX expressions and imports in Markdown
DiagnosticsPrecise error spans with line/column mapping

Built-in Passes

Common remark/rehype plugins are reimplemented as native Rust passes. No npm install, no ordering headaches.

PassDescription
SanitizationSchema-based HTML allowlist with safe defaults
Syntax HighlightingPluggable engines (syntect, Shiki)
Table of ContentsAuto-extracted heading tree

Platform Support

unifast runs on multiple platforms from a single Rust core:

  • @unifast/node - Node.js binding via N-API (napi-rs). Primary target.

  • @unifast/core - TypeScript type definitions shared across all packages.

  • unifast (CLI) - Command-line interface for scripts and CI.

  • WASM - Browser and edge runtime support (secondary target).

Non-goals

unifast is not a drop-in replacement for unified. It does not:

  • Execute existing remark/rehype JS plugins inside the core.

  • Provide API compatibility with the unified ecosystem.

  • Depend on Node’s module resolution in the core compilation path.

Instead, it targets use-case completeness - covering what most projects need without the complexity of assembling a plugin pipeline.