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

ansi-chart

v0.0.5

Published

A lightweight and simple tool for rendering beautiful charts directly in your terminal using only ANSI-compatible ASCII characters. Create bar charts, line graphs, and more with customizable styles, all without external dependencies. Perfect for CLI appli

Readme

ansi-chart

A lightweight and simple tool for rendering beautiful charts directly in your terminal using only ANSI-compatible ASCII characters. Create bar charts, line graphs, and more with customizable styles—no extra dependencies needed. Perfect for CLI applications, monitoring scripts, or just adding some visual punch to your console outputs!

Installation

npm install ansi-chart

Usage

1. Create a Dataset

Use the Dataset class to pass in your data:

import { Dataset } from 'ansi-chart';

const dataset = new Dataset([
  [1, 2],
  [2, 3],
  [3, 4],
  [4, 5],
  [5, 6],
]);

Here, each sub-array ([x, y]) is a coordinate to plot. You can create as many datasets as you want and feed them to different chart types.

2. Plot a Scatter Chart

The ScatterPlot shows points for each data coordinate:

import { ScatterPlot, Dataset } from 'ansi-chart';

const scatterPlot = new ScatterPlot();
const dataset = new Dataset([
  [1, 2],
  [2, 3],
  [3, 4],
  [4, 5],
  [5, 6],
]);

scatterPlot.plot(dataset, [1, 1, 2, 1, 1, 2]);

Screenshot

3. Plot a Line Chart

Line charts connect the data points with ASCII lines:

import { LineChart } from 'ansi-chart';

const monthlySalesData = [
  1200, 1560, 2130, 1700, 960, 1450, 1600, 1350, 1200, 1400, 1700, 2200, 2100, 2000, 1800, 1850, 1730, 1800, 1360, 1450,
  1600, 1350, 1130, 1600,
];

const salesChart = new LineChart({
  xLabel: 'Days',
  yLabel: 'Sales (in USD)',
  height: 10,
});

salesChart.plot(monthlySalesData, '#ff4c33');

Screenshot

LineChart Options:

•	xLabel and yLabel: Custom labels for the axes.
•	height: Adjust how tall your chart should be in the terminal.
•	plot(data, color): Data is an array of [x, y] pairs. The second argument can be a color or style code (or skip it for a default style).

Now you’re ready to add terminal charts to your projects with minimal fuss. Enjoy the nostalgia of ASCII while showcasing your data in style!