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

topographer

v0.3.0

Published

Visualize repo changes as a collapsible dependency graph in a single HTML file.

Readme

topographer

Visualization of repo changes.

A collapsible dependency graph of a codebase, excluding 3rd-party modules. Node labels are the file/module name. Edges indicate a dependency/import.

Node colors:

  • blue — unchanged in this commit
  • green — added in this commit
  • orange — modified in this commit
  • red — deleted in this commit

Edge style:

  • solid — direct dependency
  • dashed — dynamic import

Usage

Run the script in the repo root:

npx topographer [options] [root]

Options:

  • -o, --out <file> — Output HTML file (default: .topographer/map.html under root; topo.json and crap.jsonl land beside it)
  • -r, --root <dir> — Repo root to scan (default: current directory)
  • --no-crap — Skip CRAP annotation (CC² × (1−cov)³ + CC; on by default)
  • --coverage <file> — Coverage report (Istanbul coverage-final.json or LCOV); default: auto-detect under coverage/
  • -v, --version — Print version and exit
  • -h, --help — Show this help

If it's not a git repo, everything is treated as "this commit". If it is a git repo, the current state is "this commit".

Outputs

  • map.html — Interactive visualization of the dependency graph with optional CRAP risk view overlay.
  • topo.json — Serialized graph (nodes, links, git status, manifest, and annotations unless --no-crap).
  • crap.jsonl — Per-function CRAP scores and metadata (one JSON record per line, sorted by CRAP score descending, no-coverage functions last). Skipped with --no-crap.

All three land in ./.topographer/ by default (or beside the -o target), and the CLI prints each written path on completion.

Risk View

CRAP annotation runs by default (skip with --no-crap). The risk view highlights files by function complexity and coverage — click the Risk toggle in the map to enable it:

  • Heat halo (color #e25822) — Size and opacity scale with the maximum CRAP score in the file (larger and more opaque = more risky)
  • Gray dashed halo — File has no numeric CRAP score at all (every function lacks coverage data); a file with even one scored function gets a heat halo instead. Null coverage is distinct from 0% coverage.

Collapsed nodes display a badge showing the max CRAP score and count of above-threshold functions across the node's hidden subtree (not just the node's own file). Functions without coverage data are visibly separate from those with 0% coverage, making it clear where coverage is missing vs. explicitly low.