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

@einere/ccusage-graph

v1.1.0

Published

CLI tool to visualize ccusage JSON reports as terminal graphs

Readme

ccusage-graph

A CLI tool to visualize ccusage JSON reports as terminal graphs.

Features

  • Cost bar chart (daily / weekly / monthly)
  • Token usage bar chart (daily / weekly / monthly)
  • Cost breakdown by model
  • Period summary (total cost, average, peak period, etc.)
  • Auto-detects JSON format from top-level key (daily, weekly, monthly)

Usage

Pipe from ccusage (recommended)

npx ccusage@latest --json | npx @einere/ccusage-graph
npx ccusage@latest weekly --json | npx @einere/ccusage-graph
npx ccusage@latest monthly --json | npx @einere/ccusage-graph

File argument

npx ccusage@latest --json > report.json
npx @einere/ccusage-graph report.json

Redirect

npx @einere/ccusage-graph < report.json

Output Example

Daily

📊 Daily Cost
────────────────────────────────────────────────────────────────────────────────
  01-19    $7.34 ████████████████████████████████████████░░░░░░░░
  01-25    $4.49 ████████████████████████░░░░░░░░░░░░░░░░░░░░░░░
  ...
────────────────────────────────────────────────────────────────────────────────

📋 Summary
────────────────────────────────────────────────────────────────────────────────
  Period:        2026-01-19 → 2026-02-18 (5 active days)
  Total Cost:    $12.19
  Avg/Day:       $2.44
  Peak Day:      2026-01-19 ($7.34)
────────────────────────────────────────────────────────────────────────────────

Weekly

📊 Weekly Cost
────────────────────────────────────────────────────────────────────────────────
  01-18    $7.34 █░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  01-25   $18.69 ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ...
────────────────────────────────────────────────────────────────────────────────

📋 Summary
────────────────────────────────────────────────────────────────────────────────
  Period:        2026-01-18 → 2026-02-15 (5 active weeks)
  Total Cost:    $410.83
  Avg/Week:      $82.17
  Peak Week:     2026-02-08 ($230.84)
────────────────────────────────────────────────────────────────────────────────

Monthly

📊 Monthly Cost
────────────────────────────────────────────────────────────────────────────────
  2026-01   $26.04 ███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  2026-02  $384.80 ████████████████████████████████████████
────────────────────────────────────────────────────────────────────────────────

📋 Summary
────────────────────────────────────────────────────────────────────────────────
  Period:        2026-01 → 2026-02 (2 active months)
  Total Cost:    $410.83
  Avg/Month:     $205.42
  Peak Month:    2026-02 ($384.80)
────────────────────────────────────────────────────────────────────────────────

Input JSON Format

Uses the JSON format generated by ccusage as-is. The tool auto-detects the format from the top-level key.

Daily

{
  "daily": [
    {
      "date": "2026-01-19",
      "totalTokens": 10412828,
      "totalCost": 7.34,
      "modelBreakdowns": [{ "modelName": "claude-opus-4-5-20251101", "cost": 7.11, ... }]
    }
  ],
  "totals": { "totalCost": 12.19, "totalTokens": 20300000, ... }
}

Weekly

{
  "weekly": [
    {
      "week": "2026-01-18",
      "totalTokens": 10412828,
      "totalCost": 7.34,
      "modelBreakdowns": [{ "modelName": "claude-opus-4-5-20251101", "cost": 7.11, ... }]
    }
  ],
  "totals": { "totalCost": 12.19, "totalTokens": 20300000, ... }
}

Monthly

{
  "monthly": [
    {
      "month": "2026-01",
      "totalTokens": 34720100,
      "totalCost": 26.04,
      "modelBreakdowns": [{ "modelName": "claude-opus-4-5-20251101", "cost": 25.46, ... }]
    }
  ],
  "totals": { "totalCost": 410.83, "totalTokens": 597631053, ... }
}

Requirements

  • Node.js >= 18

License

MIT