I don't like how messy JS environments and tooling are, so I built godraw, a pure Go CLI and library to render .excalidraw files to PNG and SVG offline without Node, Playwright, or Chrome.
It compiles to a single static binary (CGO_ENABLED=0) with the standard Excalidraw fonts embedded.
| godraw | @excalidraw/cli |
|
|---|---|---|
| Runtime | Single static binary | Node.js >=22 + Playwright + Chrome/Firefox |
| Network | Offline by default | Fetches fonts / cloud APIs |
| PNG 1x cold start | ~50 ms | ~5,800 ms |
| SVG + font subsetting | ~30 ms | ~5,700 ms |
| Library | import "github.com/alexrios/godraw" |
CLI only |
brew install alexrios/tap/godraw
go install github.com/alexrios/godraw/cmd/godraw@latest
go get github.com/alexrios/godrawgodraw render drawing.excalidraw --out drawing.png
godraw render drawing.excalidraw --out drawing.svg --theme dark
godraw render deck.excalidraw --all-frames --out slides/
godraw render drawing.excalidraw --frame-id frame_1 --out frame.png --scale 2 --transparent
cat drawing.excalidraw | godraw render - --out - > drawing.pngFlags for godraw render <file>:
--out <path|->(required): output file, directory (with--all-frames), or-for raw stdout bytes--format <png|svg>: output format (inferred from--outextension by default)--frame-id <id>,--all-frames: render a single frame or all frames--scale <0..16>,--padding <0..1000>,--max-width <1..16384>,--max-height <1..16384>--theme <light|dark>,--transparent--fonts-url <dir|url|none>(EXCALIDRAW_FONTS_URL): optional source for Xiaolai CJK fonts--timeout <ms>
Output files are written atomically and a JSON summary is printed to stdout. Passing --out - writes raw PNG/SVG bytes to stdout instead.
scene, err := godraw.ParseSceneFile("drawing.excalidraw")
res, err := godraw.RenderPNG(ctx, scene,
godraw.WithScale(2),
godraw.WithTheme(godraw.ThemeDark),
)
// Also: godraw.RenderSVG, godraw.RenderToImage, godraw.RenderAllFrames