Open Source
npm Package
TypeScript
md2pdf
Production-grade open-source Markdown to PDF rendering engine for Node.js that converts Markdown into high-fidelity PDFs using Playwright, Chromium, and the Unified processing pipeline.
Version
v0.1.6
Downloads
1.2k/mo
Build Status
Passing
License
MIT
Runtime
Node.js
>=18.0.0
Installation
npm install @amitdevx/md2pdf
# or
pnpm add @amitdevx/md2pdf
Practical Use Cases
README.md ➔ README.pdf
import { convert } from "@amitdevx/md2pdf";
const result = await convert({input: "./README.md", output: "./README.pdf",});Automated Release Notes
# GitHub Actions automated generation
md2pdf CHANGELOG.md --output release.pdfTechnical Documentation
md2pdf docs/architecture.md \--output build/architecture.pdf \--toc \--paper A4Resume Generation
md2pdf resume.md \--output resume.pdf \--margin 15mmRendering Pipeline
Loading architecture flowchart...
Key Features
- Chromium-powered rendering
- Unified AST pipeline (Remark/Rehype)
- JavaScript & TypeScript API
- Command-line interface
- Professional Typography
- Syntax highlighting (Shiki)
- Headers, Footers & Page Breaks
Rendered Output
Side-by-side comparison showcasing typography, syntax highlighting, and layout accuracy.
document.md
# System Architecture
The **md2pdf** engine supports full syntax highlighting.
## Code Example
```javascript
const render = () => {
return "High fidelity!";
};
```
> Beautiful typography is built-in.
The **md2pdf** engine supports full syntax highlighting.
## Code Example
```javascript
const render = () => {
return "High fidelity!";
};
```
> Beautiful typography is built-in.
document.pdf
System Architecture
The md2pdf engine supports full syntax highlighting.
Code Example
const render = () => {
return "High fidelity!";
};
return "High fidelity!";
};
Beautiful typography is built-in.
Release Timeline
v0.1.0
Initial rendering engine
v0.1.2
Improved document rendering
v0.1.4
CLI improvements
v0.1.6 (Current)
Stability, regression testing, rendering polish
Engineering Focus
The project demonstrates building and maintaining a production-quality open-source developer tool with emphasis on:
API Design
CLI UX
Regression Testing
Rendering Accuracy
Type Safety
Documentation
OSS Maintenance
Semantic Versioning