@mdpdf/mdpdf
v0.1.7
Published
Convert Markdown to PDF using a self-contained Rust binary
Downloads
19,956
Readme
mdpdf
Convert Markdown to PDF with a self-contained Rust binary via CLI or Node.js.
Features
- Convert Markdown to PDF using Typst
- Self-contained (no large external dependencies)
- Cross-platform support (x86_64 and aarch64)
- Node.js bindings via napi-rs
- Syntax highlighting for code blocks
Example Output
Usage
Basic Usage
CLI
mdpdf README.md -o README.pdfNode.js
npm install @mdpdf/mdpdf
# or
yarn add @mdpdf/mdpdf
# or
pnpm add @mdpdf/mdpdfimport { markdownToPdf } from "@mdpdf/mdpdf";
const pdfBytes = await markdownToPdf("# this is markdown");Development
CLI
cargo build --release --features cli
cargo testNode.js
corepack yarn install --immutable
corepack yarn build
CI=1 corepack yarn testThis project requires the Yarn version pinned in package.json. Use
corepack yarn rather than a globally installed yarn; this avoids falling
back to Yarn 1 and ensures failed N-API builds cannot leave index.d.ts empty.
