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

@anirudw/repolens

v0.3.7

Published

A CLI tool to visualize repository dependency graphs

Readme

Repolens

NPM Version NPM Downloads License

Repolens is a repository intelligence CLI that scans source trees and builds a dependency graph to surface architectural signals such as hubs, coupling, instability, and implementation relationships.

It is designed for fast, practical analysis in real-world codebases and currently supports JavaScript, TypeScript, Python, Java, and Markdown.

Why Repolens

  • Identify critical files that many others depend on.
  • Spot unstable files likely to create churn.
  • Find concrete implementations of an interface or base class.
  • Export graph data as JSON for custom dashboards and automation.
  • Get a concise repository summary without heavyweight setup.

Features

  • Multi-language scanning using tree-sitter parsing.
  • Dependency graph construction and ranking.
  • Architectural health report:
    • Top core dependencies by afferent coupling ($Ca$)
    • Top unstable files by instability ($I = \frac{Ce}{Ca + Ce}$)
  • Interface implementation lookup via --implements.
  • JSON export for machine-readable output.
  • Verbose mode for parser and scan diagnostics.

Installation

Install globally from npm:

npm install -g @anirudw/repolens

Verify installation:

repolens --version

Quick Start

Run in the current directory:

repolens

Run against a specific repository path:

repolens /path/to/repo

Print architectural health metrics:

repolens /path/to/repo --health

Export analysis as JSON:

repolens /path/to/repo --format json --output repolens-graph.json

Find files implementing an interface/base class:

repolens /path/to/repo --implements ILogger

Command Reference

repolens [path] [options]
  • [path] optional directory to scan (defaults to current working directory)

Options

  • -v, --verbose enable verbose output
  • -f, --format <format> output format: text or json (default: text)
  • -o, --output <file> output file path for JSON export
  • -i, --implements <interfaceName> list files implementing an interface/base class
  • --health print architectural health metrics and exit
  • -V, --version print CLI version
  • -h, --help show help

Example Output

Summary mode (repolens)

Health mode (repolens --health)

Implementation Search (repolens --implements <name>)

Supported Languages

  • JavaScript: .js, .jsx, .mjs, .cjs
  • TypeScript: .ts, .tsx, .mts, .cts
  • Python: .py
  • Java: .java
  • Markdown: .md, .markdown

Development

Clone and install dependencies:

npm install

Run in dev mode:

npm run dev -- /path/to/repo --health

Build distributable CLI:

npm run build

Run tests:

npm test -- --run

Type check:

npm run lint

Troubleshooting

  • If a global install appears stale, reinstall the latest version:
npm uninstall -g @anirudw/repolens
npm install -g @anirudw/repolens@latest
  • Use verbose mode to inspect parse warnings:
repolens /path/to/repo --verbose
  • Use --health or --implements when you want focused output (they exit early by design and do not print summary mode).

License

MIT. See LICENSE.