Introduction
A modern markdown parser built for TypeScript that handles both complete documents and incremental streaming content. Perfect for parsing LLM markdown streams, building documentation sites, or rendering user-generated content.Installation
Get started with npm, yarn, or pnpm in seconds
Quick start
Parse your first markdown in under 5 minutes
API reference
Explore the complete API documentation
React integration
Render markdown with React Server Components
Why markdown-parser?
Streaming support
Built-in support for incremental parsing. Feed growing input and emit only finalized blocks - ideal for LLM streams.
CommonMark compliant
100% support for the CommonMark specification plus GitHub Flavored Markdown tables.
Fully typed
Complete TypeScript types for all nodes and API methods. Get autocomplete and type safety out of the box.
React ready
Optional React package for server-side rendering with customizable components.
Features
Block nodes
Supports all CommonMark block-level elements:- Headings (ATX and setext style)
- Paragraphs
- Code blocks (fenced and indented)
- Thematic breaks (horizontal rules)
- HTML blocks
- Blockquotes
- Lists (ordered and unordered)
- Link reference definitions
- Tables (GitHub Flavored Markdown)
Inline nodes
Full support for inline formatting:- Text and code spans
- Hard and soft breaks
- Inline HTML
- Autolinks, links, and images
- Emphasis and strong emphasis
How it works
The parser converts markdown text into a structured, fully-typed AST (Abstract Syntax Tree) of block and inline nodes. You can parse complete documents or use streaming mode to handle incremental content:Next steps
Install the package
Choose your package manager and install markdown-parser
Follow the quickstart
Parse your first markdown document in minutes