Parse, create & serialize
markdown with ease
Block-based API for working with markdown. Zero dependencies. TypeScript support. Built for modern frameworks.
Simple, intuitive API
Parse markdown to blocks, manipulate them, and serialize back to markdown.
import { parse, stringify, h1, paragraph } from 'create-markdown';
// Parse markdown to blocks
const blocks = parse(`# Hello World
This is **bold** text.`);
// Create blocks programmatically
const doc = [
h1('Welcome'),
paragraph('Start building with blocks.'),
];
// Serialize back to markdown
const markdown = stringify(doc);
Complete Workflow
From parsing to creation to serialization — all with type safety.
Parse
Markdown → Blocks
Convert any markdown string into structured, typed blocks that you can manipulate programmatically.
import { parse } from 'create-markdown';
const blocks = parse(`
# Getting Started
Welcome to **create-markdown**!
- Zero dependencies
- Full TypeScript support
- Block-based architecture
`);
console.log(blocks);
// → [HeadingBlock, ParagraphBlock, ListBlock]
Create
Type-safe builders
Build documents programmatically with intuitive factory functions.
import { h1, paragraph, bulletList } from 'create-markdown';
const doc = [
h1('My Document'),
paragraph('Build docs programmatically.'),
bulletList([
'Type-safe block creation',
'Intuitive API design',
'Full markdown support',
]),
];
Serialize
Blocks → Markdown
Convert blocks back to clean, formatted markdown output.
import { stringify } from 'create-markdown';
const markdown = stringify(doc);
// Output:
// # My Document
//
// Build docs programmatically.
//
// - Type-safe block creation
// - Intuitive API design
// - Full markdown support
Zero Dependencies
Lightweight core
Full TypeScript
Complete types
Framework Ready
Works everywhere
Everything you need
A complete toolkit for working with markdown in modern applications.
Block-Based
Work with structured blocks instead of raw strings. Parse, manipulate, and serialize with ease.
Zero Dependencies
Core package has no runtime dependencies. Lightweight and fast.
Framework Ready
Works with Next.js, Vite, Remix, Astro, and more. React components included.
Full TypeScript
Complete type definitions with generics. Excellent DX with autocomplete.
Ready to get started?
Install create-markdown and start building in minutes.
bun add create-markdown