Render benchmark charts to PNG. No browser, no JS deps.
npm install -D pretty-benchcat > bench.yaml <<'EOF'
version: 1
type: grouped-bar
title: JSON parse
labels: [run-1, run-2, run-3]
series:
- { name: main, values: [1200, 1180, 1215] }
- { name: branch, values: [1350, 1340, 1362] }
EOF
npx pretty-bench render bench.yaml bench.pngSupports JSON, YAML, and TOML. Chart types: bar, grouped-bar, line.
pretty-bench render <input> <output>
pretty-bench validate <input>
pretty-bench init <output> [--type grouped-bar]
pretty-bench validate bench.yaml
pretty-bench render bench.yaml bench.png
pretty-bench init benchmarks/example.yaml --type lineimport { render, validate } from "pretty-bench";
await validate("bench.yaml");
await render("bench.yaml", "bench.png");version: 1
type: grouped-bar
title: JSON parse
subtitle: main vs branch
unit: ops/sec
labels: [run-1, run-2, run-3]
series:
- name: main
values: [1200, 1180, 1215]
- name: branch
values: [1350, 1340, 1362]Optional fields:
subtitleunitwidthheightseries[].coloryAxis.minyAxis.max
Full schema: schemas/pretty-bench-v1.schema.json.
Starter specs:
pretty-bench init bench.jsonpretty-bench init bench.yaml --type grouped-barpretty-bench init bench.toml --type line
- run: npx pretty-bench render bench.yaml bench.png
- run: git diff --exit-code bench.pngBuild, packaging, and publishing notes live in CONTRIBUTING.md.
MIT
