v0.6 · MIT · pure Nim · zero dependencies

Mermaid diagrams, without the browser.

nimaid turns Mermaid text into PNG, GIF and SVG in milliseconds. No headless Chrome, no Node, no system fonts: one small native library you can call from Python, JavaScript, C, C++ or the command line.

pip install nimaid
18diagram types
0runtime dependencies
< 2 MBCLI binary
2 MBWebAssembly module (0.8 MB gzipped)
15build targets

Why nimaid

Rendering Mermaid usually means starting a headless browser. nimaid parses, lays out and draws everything itself.

No browser, no runtime

Parser, Mermaid-compatible layout, vector rasteriser, TrueType text and encoders are all written in Nim. DejaVu Sans is built in, so it works the moment it is installed.

Runs everywhere

CLI and C API for Linux (glibc and musl), macOS, Windows and FreeBSD on x86, ARM and RISC-V; Python wheels; and one WebAssembly build for Node, Deno, Bun and browsers.

Deterministic output

The same input gives the same bytes on every platform. SVGs use outlined glyphs, so they look identical in every viewer. Colour emoji are opt-in.

Eighteen diagram types

Everything below was rendered by nimaid. Click a card to open its source in the live playground and edit it.

Layouts follow Mermaid's own algorithms but are not pixel-identical to mermaid.js. See the FAQ for what is and is not supported.

Use it from anywhere

Same renderer in every binding.

pip install nimaid

import nimaid
open("hello.png", "wb").write(nimaid.png("flowchart LR\n  A[Hello] --> B[World]"))
svg = nimaid.svg("sequenceDiagram\n  Alice->>Bob: Hi", theme="dark")

How it compares

nimaid against the usual headless-browser approach to rendering Mermaid on a server or in CI.

nimaidHeadless browser (e.g. mermaid-cli)
Needs a browser engineNoYes (Chromium via Puppeteer)
Runtime dependenciesNoneNode.js plus a browser download
Runs in the browser without a serverYes (WebAssembly)n/a (mermaid.js runs there natively)
Embeddable from C, Python, NimYesVia a subprocess
Byte-identical output across platformsYesDepends on browser and fonts
Pixel-identical to mermaid.jsNo (same algorithms, own renderer)Yes

If you need pixel-exact mermaid.js output or a diagram type nimaid does not have yet, a browser-based renderer is the right tool. nimaid is for pipelines, servers, docs builds and apps where starting a browser is the problem.

See it for yourself

Paste Mermaid, get a diagram. It all runs in your browser, nothing is uploaded.

Open the playground