You don't need to leave the terminal to visualize your dataset.
chartex renders compact, beautiful ASCII charts for terminals and scripts from plain JSON/NDJSON/CSV input or a CLI. It is written in ReScript and shipped as a tiny ESM library so you can embed charts in scripts.
- Small, zero-dependency renderers: Bar, Bullet, Scatter, Sparkline, Pie/Donut/Gauge available in the library.
- Works with any data shape via accessor-based configs (no pre-transforms required).
- Includes a CLI for piping data-in → ASCII chart-out.
- Thoroughly tested ReScript core with JavaScript-compatible build artifacts.
Note
Requirements: Node.js 22+
npm install chartex- Create a file
example.mjsand paste:
import { Bar } from "chartex";
const data = [
{ name: "Jan", total: 45 },
{ name: "Feb", total: 67 },
{ name: "Mar", total: 82 },
];
const chart = Bar.make(data, {
key: (d) => d.name,
value: (d) => d.total,
style: (d) => (d.total > 60 ? "█" : "░"),
}, { height: 10 });
console.log(chart);- Run it:
node example.mjsYou can install the CLI globally or use npx to run it without installing:
npm install -g chartexBasic usage:
npx chartex [options] [file]Note
Full CLI options reference: docs/cli.md
📖 Full docs at metalbolicx.github.io/chartex
Contributions welcome — open issues or PRs.
npm run res:build # compile ReScript
npm run res:test # run tests
npm run cli:build # bundle CLI (if CLI changed)
npm run build # build dist/ artifacts (tsdown)
npm run res:clean # clean ReScript outputsReleased under MIT by @MetalbolicX.




