Peisar parses CommonMark Markdown with GitHub Flavored Markdown (GFM), Kramdown block attributes, YAML front matter, source spans, AST visitors, custom parser hooks, and a Rust-first architecture that is also exposed to Node.js through N-API.
[!NOTE] The README is intentionally short so the npm and crates.io pages stay easy to scan. Detailed guides now live in the repository under
docs/, which lets the project update documentation between package releases.
Features
- CommonMark blocks and inlines, including HTML and reference links
- GFM tables, strikethrough, task lists, and autolinks
- Kramdown block attributes such as
{:#intro .lead key="value"} - YAML front matter extraction
- AST visitors and parser hooks through
usePlugin() - Native Node.js addon and Rust library surfaces
Install
Node.js
Rust
[]
= "1.0.0"
Quick start
Node.js
const = require;
const document = ;
console.log;
console.log;
console.log;
Rust
use ;
use ;
let doc = parse;
let html = render_document_html;
assert_eq!;
Documentation
Node.js usage
Browser usage
Rust usage
Benchmarks
Other docs
Packages and examples
- npm: https://www.npmjs.com/package/peisar
- crates.io: https://crates.io/crates/peisar
- Next.js example: https://github.com/phothinmg/peisar/tree/main/examples/next
- Vite example: https://github.com/phothinmg/peisar/tree/main/examples/vite
Development
More detail in CONTRIBUTING.
AI integration
Peisar supplies Agent Skills for AI coding tools:
- peisar-parse-markdown: consume the Node.js and Rust Markdown APIs
- peisar-ast-visitors: make post-parse AST transformations
- peisar-parser-hooks: add syntax recognized during parsing
- peisar-development: modify and validate the codebase
License
Security policy: SECURITY.md