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

@amarnotcool/repotool

v0.2.0

Published

Zero-dependency CLI that reads, graphs, queries and diffs a git repository using only the Node.js standard library.

Downloads

316

Readme

repotool

A CLI that reads, graphs, questions and diffs a git repository — built on the Node.js standard library and nothing else. No chalk, no commander, no diff, no simple-git. dependencies in package.json is empty, and verify-zero-deps.sh proves it.

Run it

Nothing to install, nothing to build — run it straight from the registry inside any git repository:

npx @amarnotcool/repotool graph

Or install it once and use the short command everywhere:

npm i -g @amarnotcool/repotool
repotool graph

That global install pulls exactly one package: this one. dependencies is empty, so there is no transitive tree behind it.

From a clone, no install step at all:

node bin/repotool.js graph

Node 18 or newer and a git binary on PATH are the only requirements.

Commands

repotool graph

Parses the full commit and merge history and draws it as a lane graph. * is a commit, M a merge, o a root commit.

8 commit(s), on branch main

M      f27040a 2026-08-20 Ada Lovelace (main) Merge hotfix
|\
| *    2c2040d 2026-08-20 Ada Lovelace (hotfix) Hotfix
| |
M |    0eb3d2e 2026-08-20 Ada Lovelace Merge feature into main
|\|\
* | |  5a22eb4 2026-08-20 Ada Lovelace Add readme
| |/
| *    ab19254 2026-08-20 Grace Hopper (feature) Extend feature
| |
| *    ef60ae3 2026-08-20 Grace Hopper Add feature file
|/
*      01f599d 2026-08-20 Ada Lovelace Tweak app
|
o      231d066 2026-08-20 Ada Lovelace Initial commit

Flags: --limit N, --branch REF, --no-dates, --repo PATH, --no-color.

repotool stats

One screen describing the repository: size, people, branches, churn, and where the changes land.

repotool stats — Zero Dependency  on branch main

commits        11
contributors   1
branches       1 local, 1 remote
files touched  25
line churn     6,373  +5,691 / -682
history        2026-08-20 → 2026-08-21  (1 day)
last commit    43 minutes ago

Top 3 contributors
──────────────────
11  ████████████████  Devpratap

Top 3 most-changed files
────────────────────────
6 commits  302 lines  README.md
5 commits  596 lines  src/git-reader.js
5 commits  516 lines  bin/repotool.js

repotool hotspots

Files ranked by how much attention they attract — change frequency, how many different people touch them, and how many lines move. The score weights all three and the weighting is printed with the table rather than hidden.

repotool hotspots
repotool hotspots --limit 25 --sort churn

Sort by score (default), commits, churn or authors.

repotool ask "<question>"

Deterministic answers to fixed question shapes — a keyword matcher over parsed git data, not a language model, so the same question always gives the same answer and nothing leaves your machine.

repotool ask "who last touched src/git-reader.js"
repotool ask "who works most on src/git-reader.js"
repotool ask "what has changed recently"
repotool ask "why is this repository changing so much"
repotool ask "how many commits by Ada"
repotool ask "what files changed in HEAD~2"
repotool ask "show the last 10 commits"
repotool ask "which file changed the most often"
repotool ask "what branches exist"
repotool ask "when was 01f599d committed"

why is this repository changing so much is arithmetic, not opinion: it compares the recent commit rate against the earlier baseline, names the files recent churn concentrates in, and says who is driving it — and it declines to quote a per-day rate when the history is too compressed in time to support one.

Ask something unsupported and it prints the list of what it can answer.

repotool diff <commitA> [commitB]

Colourised unified diff between two revisions, computed by our own Myers diff implementation.

repotool diff HEAD~3 HEAD
repotool diff main feature --context 5
repotool diff HEAD~1 HEAD --stat

Zero-dependency proof

node verify-zero-deps.js     # runs anywhere Node runs
sh verify-zero-deps.sh       # same checks, POSIX shell

Both check the same three things: the dependencies block is empty, every require in src/, bin/ and test/ resolves to a Node built-in or a relative path, and no unexpected node_modules tree is present. The Node version needs no shell, so it works on Windows without Git Bash.

See STDLIB.md for the full package-by-package substitution log.

Tests

npm test        # or: node --test "test/*.test.js"

The suite builds real throwaway git repositories and covers empty repos, a single root commit, merge commits, detached HEAD, malformed git output, a randomised round-trip property for the diff algorithm, and the dependency proof itself — planting a third-party import to confirm the checker fails.

Design

Five commands over one shared reading layer. Feature modules never reach into each other's internals.

bin/repotool.js       argv routing, per-command help
src/index.js          public API for using repotool as a library
src/git-reader.js     the only file that talks to git
src/analysis/         shared repo model + stats and hotspots reports
src/graph/            DAG layout + ASCII renderer
src/query/            question -> intent -> answer
src/diff/             Myers diff + unified-diff renderer
src/format.js         column alignment, number grouping, relative dates
src/ansi.js           escape codes, TTY/NO_COLOR aware

src/analysis/repo-model.js reads the history once — commits, contributors, branches and per-file churn, the last of these from a single git log --numstat — and every report and aggregate question is folded from that one pass rather than re-deriving its own.

Feature modules are required lazily, both in the CLI and in src/index.js, so a problem in one feature cannot stop the other two from running.

Use it as a library

const { readCommits, buildGraph, renderAscii, diffLines, parseQuestion } = require('@amarnotcool/repotool');

const { commits } = readCommits({ cwd: '/path/to/repo' });
console.log(renderAscii(buildGraph(commits)));

git-reader shells out to the git binary for raw data only — commit metadata, file lists, blob contents. Every piece of interpretation (graph layout, question answering, diffing) is our own code.

License

MIT — see LICENSE.