极致 快速 的 Markdown 编译器

使用 Rust 构建的高性能 Markdown / MDX 编译器。
比 unified 最高快 25 倍

$npm install @unifast/node

性能基准

Markdown 到 HTML 的编译时间(毫秒)。数值越低越好。

120 lines
0.18ms
4.78ms
27x
560 lines
0.41ms
11.22ms
27x
2,000 lines
1.2ms
31.51ms
26x
unifastunified + remark + rehype

你需要的 API,全部内置。

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 驱动

核心编译器采用 Rust 编写,支持零拷贝解析和 arena 内存分配。

🔋开箱即用

内置 20 多个插件:GFM、数学公式、表情符号、语法高亮、frontmatter 等。

🌈双高亮引擎

内置 Tree-sitter 和 syntect,比 rehype-highlight 最高快 8 倍。

⚛️MDX 支持

一流的 MDX 编译能力,支持 JSX 和表达式。

赞助商