npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mddoc-cli

v0.1.1

Published

Generate mind map and architecture diagram PNGs from .mmd and .d2 source files

Readme

mddoc-cli

Generate mind map and architecture diagram PNGs from .mmd and .d2 source files — for embedding in system design Markdown documents.

Install

npm install -g mddoc-cli

For architecture diagrams, also install d2:

# macOS
brew install d2

# Linux / Windows — see https://d2lang.com/tour/install

Commands

mddoc mindmap <file.mmd>

Render a markmap mind map source file to PNG.

mddoc mindmap .mddoc/overview.mmd
# → .mddoc/overview.png

mddoc mindmap .mddoc/overview.mmd -o docs/overview.png

Input format — standard Markdown headings, depth = tree level:

# System Overview

## User Layer
- Web Client
- Mobile App

## Service Layer
- API Gateway
  - Auth
  - Rate Limiting
- Order Service

## Data Layer
- PostgreSQL
- Redis

mddoc arch <file.d2>

Render a D2 architecture diagram source file to PNG.

mddoc arch .mddoc/system-arch.d2
# → .mddoc/system-arch.png

mddoc arch .mddoc/system-arch.d2 -o docs/system-arch.png --theme 200

Input format — D2 diagram language:

direction: right

client: Client {shape: rectangle}
gateway: API Gateway {shape: rectangle}
db: PostgreSQL {shape: cylinder}
cache: Redis {shape: cylinder}

client -> gateway
gateway -> db
gateway -> cache

mddoc build [dir]

Scan .mddoc/ in the given directory (default: current directory) and regenerate PNGs for every .mmd and .d2 file found.

# from project root
mddoc build

# from a specific directory
mddoc build ./docs

Recommended project layout

your-project/
├── .mddoc/
│   ├── overview.mmd        ← mind map source
│   ├── overview.png        ← generated (committed to repo)
│   ├── system-arch.d2      ← architecture diagram source
│   └── system-arch.png     ← generated (committed to repo)
└── DESIGN.md

Embed in Markdown with a link back to the source so LLMs can also read the diagram:

![脑图:系统概览](.mddoc/overview.png)
*源文件:[overview.mmd](.mddoc/overview.mmd)*

![架构图:系统架构](.mddoc/system-arch.png)
*源文件:[system-arch.d2](.mddoc/system-arch.d2)*

Options

| Flag | Command | Description | |------|---------|-------------| | -o, --output <path> | mindmap, arch | Custom output PNG path | | -t, --theme <id> | arch | D2 theme ID (default: 0) |

Dependencies

| Package | Purpose | |---------|---------| | markmap-lib | Parse .mmd markdown into a tree | | @resvg/resvg-js | Rasterise SVG → PNG (pre-built native binaries, no system deps) | | d2 CLI | Render .d2 → PNG (external, must be on PATH) |