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

@sprawlens/cli

v0.2.1

Published

Visualize the structure of any TypeScript, Go, Rust or MoonBit repository

Readme

@sprawlens/cli

Visualize the structure of any TypeScript / JavaScript, Go, Rust, or MoonBit repository as a stacked, zoomable map — modules as concentric dependency rings (or a bundled treemap), subdivided down to files and symbols with capacity-constrained power diagrams, and linked by their real import / call graph.

Usage

# analyze a repo and open the structure map in the browser
npx @sprawlens/cli serve <path-to-repo>

# print the treemap in the terminal (diff-tinted)
npx @sprawlens/cli tui <path-to-repo>

# render the structure map straight to an SVG file (no browser)
npx @sprawlens/cli render <path-to-repo> --layout treemap -o map.svg

# report language detection, LSP availability, and detail features
npx @sprawlens/cli doctor <path-to-repo>

repo defaults to the current directory.

Rendering an SVG

render runs the same layout and drawing the browser does, headless in Node, and writes a standalone SVG — useful for a CI artifact that shows a change's macro shape at a glance.

npx @sprawlens/cli render . --layout treemap          # writes <repo>-treemap.svg
npx @sprawlens/cli render . --layout rings --edges     # concentric modules + dep mesh
npx @sprawlens/cli render . --level module -o map.svg  # modules only (no file cells)
npx @sprawlens/cli render . -o - > map.svg             # stream to stdout

--layout is rings or treemap (default), --level is module or file (default). The map is deterministic for a given --seed (default 1).

Deep detail via LSP

When a language server is installed, sprawlens wires it up automatically for hover and call-hierarchy detail (TypeScript also gets a compiler control-flow graph). Without one, it falls back to a tree-sitter baseline and a source-declaration preview.

| language | server | | --- | --- | | TypeScript / JavaScript | typescript-language-server (bundled) | | Rust | rust-analyzer | | Go | gopls | | MoonBit | moonbit-lsp |

Run npx @sprawlens/cli doctor to see what's detected in a given repo.

Terraform service layer

When a repo has .tf files, sprawlens parses them (via @cdktf/hcl2json, no terraform CLI needed) into a service graph — the upper layer above the code modules. Service-like resources (aws_lambda_function, aws_ecs_service, google_cloud_run_service, …) become nodes; their wiring becomes edges, typed by communication kind: queue (aws_lambda_event_source_mapping), event (aws_sns_topic_subscription), http (API Gateway integrations), and plain depends for any other cross-service reference. Toggle the services plane at the top of the map.

Map terraform resources to services (and, later, to their code dirs) in sprawlens.toml:

[terraform]
root = "infra/"            # where to scan for .tf (default: repo root)

[[service]]
name = "orders-api"
terraform = ["aws_lambda_function.orders*", "module.orders"]
source = ["services/orders/**"]   # code dir backing the service

Without any [[service]] rules, each service-like resource is its own service.

With a source mapping, toggle group by service to nest the module map inside each service node — services become the outer containers, the code lives inside, and the service-to-service links ride on top. Files outside every service's source collect in a (no service) bucket.

Requirements

  • Node.js >= 24

License

MIT