create-markdown
Block-based markdown for the modern web

Parse, create & serialize
markdown with ease

A clean, block-based API for working with markdown. Zero dependencies. Full TypeScript support. Built for modern frameworks.

Simple, intuitive API

Parse markdown to blocks, manipulate them, and serialize back to markdown.

example.ts
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);

The complete workflow

From parsing to creation to serialization — all with type safety.

1

Parse

Convert markdown strings into structured blocks.

parse.ts
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, BulletListBlock]
2

Create

Build documents programmatically with type-safe factories.

create.ts
import { h1, paragraph, bulletList, codeBlock } from 'create-markdown';

const doc = [
  h1('My Document'),
  paragraph('Build documents programmatically.'),
  bulletList([
    'Type-safe block creation',
    'Intuitive API design', 
    'Full markdown support',
  ]),
  codeBlock('console.log("Hello!");', { language: 'js' }),
];
3

Serialize

Convert blocks back to clean markdown output.

serialize.ts
import { stringify } from 'create-markdown';

const markdown = stringify(doc);

// Output:
// # My Document
//
// Build documents programmatically.
//
// - Type-safe block creation
// - Intuitive API design
// - Full markdown support
//
// \`\`\`js
// console.log("Hello!");
// \`\`\`

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