使用 Rust 打造的高效能 Markdown / MDX 編譯器。
比 unified 最高快上 25 倍 。
$npm install @unifast/node
Markdown 編譯為 HTML 所需的時間(毫秒),數值越低越好。
import { compile } from "@unifast/node";
const result = compile("# Hello\n\nThis is **unifast**.");
console.log(result.output);
// <h1 id="hello">Hello</h1>
// <p>This is <strong>unifast</strong>.</p>核心編譯器以 Rust 撰寫,採用零拷貝解析與 arena 記憶體配置。
內建 20 多種外掛:GFM、數學公式、emoji、語法高亮、frontmatter 等。
內建 Tree-sitter 與 syntect,比 rehype-highlight 最高快上 8 倍。
一流的 MDX 編譯體驗,完整支援 JSX 與運算式。