Skip to content

Repository files navigation

get-md

A fast, lightweight HTML, PDF, DOCX, and Markdown to Markdown converter optimized for LLM consumption — built by the Nano Collective, a community collective building AI tooling not for profit, but for the community. Everything we build is open, transparent, and driven by the people who use it.

Lightning-fast (<100ms) with optional AI-powered conversion using a local LLM model. Pass in HTML, PDF, DOCX, Markdown files, or a URL and get clean, structured Markdown back — as a library or from the command line.


Build Status Coverage Version NPM Downloads NPM License Repo Size Stars Forks

Quick Start

npm install @nanocollective/get-md
import { convertToMarkdown } from "@nanocollective/get-md";

const result = await convertToMarkdown("https://example.com");
console.log(result.markdown);

Or use the CLI:

npx @nanocollective/get-md https://example.com -o output.md
npx @nanocollective/get-md handbook.pdf -o output.md
npx @nanocollective/get-md document.docx -o output.md

Mermaid Diagrams

Diagrams are usually the first casualty of an HTML-to-Markdown conversion. get-md handles them four ways — the Diagrams & Mermaid guide covers each in full:

  • Preserved — a ```mermaid fence already in your HTML or Markdown comes out unchanged. On by default, no extra dependencies.
  • Recovered — when a docs site has already rendered a diagram to <svg>, get-md pulls the original source back out of the DOM. On by default.
  • Reconstructed — diagrams drawn into a PDF can be rebuilt by a remote vision model. Opt-in, best-effort; needs pdfjs-dist and @napi-rs/canvas.
  • ValidatedvalidateMermaid: true parses every Mermaid block and annotates the ones that fail, keeping the original so you can repair it. Opt-in; needs mermaid.
npm install mermaid
const result = await convertToMarkdown(source, {
  inputType: "markdown",
  validateMermaid: true,
});

Run examples/mermaid-diagrams.ts to see all of it working offline.

Documentation

Full documentation is available online at docs.nanocollective.org or in the docs/ folder:

  • Getting Started — Installation, requirements, and your first conversion
  • API Reference — Full reference for the library API
  • CLI — Command-line interface usage and options
  • Guides — LLM-powered conversion, Mermaid diagrams, React Native, and configuration tips
  • Configuration — Config files and options reference
  • Community — Contributing, Discord, and how to help

Community

The Nano Collective is a community collective building AI tooling for the community, not for profit. We'd love your help.

About

A fast, lightweight HTML to Markdown converter optimized for LLM consumption. Uses proven parsing libraries to deliver clean, well-structured markdown with intelligent content extraction and noise filtering.

Topics

Resources

Contributing

Stars

88 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Contributors

Languages