Parse source Markdown into editable tokens, render HTML, then derive sanitized page HTML, feed HTML and plain text for Yamb.
For GitHub Packages, route the @yamb scope to https://npm.pkg.github.com and install @yamb/markdown.
Requires Node.js 26.13 or later and yamb.
pnpm add yamb @meritt/yamb-markdownimport { markdown } from '@meritt/yamb-markdown';
import { prepare } from 'yamb/transform';
await using md = markdown();
const stages = [md, md.html(), md.clean()];
const source = {
uri: '2026/11/guide',
title: 'Guide',
text: 'An **example** with [a link](./next).'
};
const prepared = await prepare(source, stages, {
base: new URL('https://example.com/blog'),
timeZone: 'UTC'
});
console.log(prepared.text.html);
console.log(prepared.text.plain);For a live Post, pass post.toJSON().
- Stage representations and extension example
- Markdown dialect, cleanup and URLs, limits
- Yamb core reference for preparation and caching
- Architecture
MIT. See LICENSE.