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

markdown-graph

v0.2.0

Published

Interactive force-directed knowledge graph of a repo's Markdown corpus, colored by top contributors.

Downloads

428

Readme

markdown-graph

npm license

Interactive force-directed knowledge graph of a repository's Markdown corpus. Every tracked .md file becomes a node, internal cross-references become edges, and each node renders as a pie chart sliced by its top 3 git contributors. Folder regions render as translucent hulls under the nodes so codebase structure is visible at a glance.

Built for "LLM context visualization" — seeing what a model would traverse when reading your docs — but works equally well as a generic "what's connected to what" tool for any repo with non-trivial Markdown.

Quick start

cd path/to/your/repo
npx -y markdown-graph
# → opens http://127.0.0.1:8765/ in your browser

That's the whole flow. The tool finds your tracked .md files via git ls-files, builds the graph, vendors force-graph from the local node_modules (no CDN), and serves the viewer.

Compare with other repos

Pass --repos to combine the current directory with one or more remote GitHub repos:

npx -y markdown-graph --repos vercel/next.js,facebook/react
npx -y markdown-graph --repos .,vercel/next.js

Each owner/name is sparse-cloned (--filter=blob:none + sparse-checkout for *.md only) into $TMPDIR/markdown-graph-cache/, so re-runs reuse the clone. The viewer's dropdown lets you switch between datasets without reloading.

Options

-r, --repos <list>   comma-separated: "." | "./path" | "/abs/path" | "owner/name"
-p, --port <n>       port (default 8765)
    --no-open        don't auto-open the browser
-b, --build <dir>    build a static site to <dir> and exit (no server)

--build is what the CI workflow uses to deploy the example site to GitHub Pages. The directory is self-contained — index.html, vendor/force-graph.min.js, datasets.json, and data/<name>.json — so any static host serves it.

What gets parsed

Every tracked .md file is a node. Edges come from four kinds of references:

| Syntax | Example | | --- | --- | | Standard markdown link | [text](path/to/file.md) | | Wiki-link | [[basename]] | | Claude Code @-include | @path/to/file.md | | Backtick relative path | `path/to/file.md` (requires a /) |

Bare basenames inside backticks (`CLAUDE.md`, `README.md`) are intentionally skipped — they're usually nouns, not references, and would resolve ambiguously when the same basename exists in many subdirectories.

CHANGELOG.md files are excluded from the corpus. Contributor name variants (case, whitespace) are collapsed via a normalization pass and %aE/%aN are mailmap-aware, so a .mailmap in the source repo merges transliterations and nicknames.

Library use

const {generate} = require('markdown-graph/lib/generator');
const {runRepos, parseRepoList} = require('markdown-graph/lib/runner');

// Produce just the JSON:
await generate({root: '.', out: 'graph.json'});

// Generate + serve programmatically:
await runRepos({repos: parseRepoList('.,vercel/next.js'), port: 3000});

Layout

bin/markdown-graph.js   CLI (commander)
lib/generator.js        pure  generate({root, out, concurrency})
lib/runner.js           pure  runRepos({repos, port, openBrowser}) + sparse-clone
web/index.html          Viewer (vanilla JS + force-graph)

Dependencies

Four small runtime deps, vendored or required:

| | Why | |---|---| | commander | CLI parsing | | sirv | static HTTP serving | | open | cross-platform browser launch | | force-graph | the renderer; copied into the served temp dir at runtime |

git (and optionally gh for private repos) must be on PATH. Node 18+.

License

MIT