Get fast HTML conversion with mdream, optimized for LLMs and streaming, for founders needing markdown output.
921 stars59 forksTypeScriptQuality 9/10Updated 7/17/2026100% free ยท open source
What it does
mdream converts HTML to markdown quickly, optimized for large language models and streaming, allowing founders to easily convert HTML content to markdown format
Install / run
npm install mdream
When to use it
โขYou need to convert HTML blog posts to markdown for a new website
โขYour team wants to migrate HTML documentation to markdown for easier editing
โขYou're building a web scraper that needs to convert HTML pages to markdown for further processing
Quick start
1Import mdream in your TypeScript file with `import { mdream } from 'mdream';`
2Use the `mdream.convertHtml()` function to convert HTML to markdown, passing in the HTML string as an argument
3Configure the conversion options by passing an options object to `mdream.convertHtml()`, such as `mdream.convertHtml(html, { strict: true })`
4Test the conversion with a sample HTML string, like `const html = '<p>Hello World!</p>'; const markdown = mdream.convertHtml(html);`
5Handle errors by wrapping the conversion call in a try-catch block, like `try { const markdown = mdream.convertHtml(html); } catch (err) { console.error(err); }`
Ready-to-paste prompt
const html = '<h1>Hello World!</h1><p>This is a paragraph.</p>'; const markdown = mdream.convertHtml(html); console.log(markdown);
Heads up: Make sure you're using a compatible version of Node.js, as mdream is built with TypeScript and may not work with older versions
Saves to your device
What's inside โ free to inspect
No purchase needed
Read the entire source before you build โ unlike paid marketplaces that hide it behind a buy button.