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

@kriswill/flake-explorer

v0.1.3

Published

Interactive visualizer for Nix flakes: outputs/module tree, option provenance (defaulted vs customized), file map with git + flake.lock input info

Readme

flake-explorer

CI Release Documentation

Interactive visualizer for Nix flakes — built for dendritic (flake-parts + import-tree) configurations, works on any flake.

flake-explorer browsing a NixOS configuration: module tree on the left, portal.nix detail showing input provenance, Configures/Declares with a hover tooltip and syntax-highlighted JSON value, nixpkgs module tree on the right

Three panes:

  • Left — outputs & modules. Every flake output (nixosConfigurations, darwinConfigurations, packages, overlays, …). Expanding a configuration reveals its module hierarchy: your own module files in their directory (mounting) structure, plus per-input subtrees for modules that come from flake inputs. Badges count customized options per subtree.
  • Center — detail. Selecting a module shows Configures (option values this file sets — with mkForce/mkDefault priority chips and customized-vs-defaulted styling) and Declares (options this file defines — type, default, current value). Hovering an option shows its type, default, priority, and description. Modules from inputs show full provenance from flake.lock (url, rev, narHash, lastModified).
  • Right — files. Every .nix file the flake references, grouped by origin (self first, then inputs). Hovering a file highlights the modules it customizes on the left; selecting it shows its last git commit and which files import it / it imports.

Selections are deep-linkable (URL hash); light/dark theme; colors are stable per file/input (curated CVD-safe slots + OKLCH hash colors).

Documentation

Deeper docs live in docs/ — architecture, the extractor pipeline, the data contract, the SPA, testing — rendered at kris.net/flake-explorer/docs with a generated API reference alongside the live demo (the explorer browsing its own flake). Release notes: CHANGELOG.md.

Usage

$ nix run github:kriswill/flake-explorer -- serve /etc/nixos
flake-explorer serving /etc/nixos at http://localhost:4321

Or from npm (@kriswill/flake-explorer) — nix must be on PATH either way:

$ bunx @kriswill/flake-explorer serve /etc/nixos
$ npx @kriswill/flake-explorer serve /etc/nixos   # installs bun on demand

serve extracts the cheap manifest up front and evaluates each configuration's options on demand the first time you open it (cached by flake narHash; a full NixOS system takes a minute or two the first time). After editing the flake, POST /api/refresh re-scans it (manifest + cache reconcile) without restarting the server:

$ curl -X POST localhost:4321/api/refresh

Pre-extract instead with:

$ flake-explorer extract /etc/nixos --all           # every configuration
$ flake-explorer extract . --configs nixos/myhost   # just one

Flags: --out DIR (data dir, default ./flake-explorer-data), --port N, --all-systems, --timeout SECS.

Static export

export materializes the explorer into one standalone HTML file — no server, no nix, no runtime dependencies. Open it from file://, or host it anywhere static files go (a CDN, GitHub Pages):

$ flake-explorer export /etc/nixos --all            # every configuration
$ flake-explorer export . --configs nixos/myhost --html myhost.html

The manifest (outputs, inputs, files, import graph) is always included; --configs kind/name,... / --all pick which configurations' options are embedded (the rest show a "not included in this export" notice). The flake's own sources and each input's flake.nix are embedded by default; --sources all also embeds every file the exported configurations reference — beware that against nixpkgs-based systems this means thousands of module sources and a file that can reach tens of MB (GitHub Pages caps a single file at 100 MB).

This repo publishes its own export on every push to main via .github/workflows/pages.ymlflake.html. To do the same, copy that workflow and set the repo's Pages source to "GitHub Actions" (Settings → Pages).

How it works

  • One extract.nix evaluated via nix eval --impure --json (uses YOUR nix, never a vendored one, so store paths and registry match your system).
  • Options are walked chunk-by-chunk (per top-level namespace, splitting failing chunks recursively) because builtins.tryEval cannot catch missing-attribute/type errors — one poisoned option costs itself, not the whole configuration. Values degrade gracefully (full → no values → no values+descriptions) and every degradation is surfaced as a warning.
  • Customized-vs-default is decided by definition priority (highestPrio < 1500), not isDefined — every option with a default is "defined" by its own declaration.
  • Files are attributed to inputs by store-path prefix (including transitive inputs and patched trees à la nixpkgs.applyPatches); your own files get per-file git log info.

Development

$ nix develop          # bun + git
$ bun install
$ bun flake-explorer.ts serve /etc/nixos
$ bun test             # unit tests (happy-dom)
$ bunx svelte-check --tsconfig ./tsconfig.json
$ nix build            # package + offline test derivation
$ bun run docs         # build the docs site into _site/docs

Svelte 5 (runes) bundled by Bun.build + bun-plugin-svelte — no Vite. Data contract between the extractor and the SPA lives in src/schema.ts.

License

MIT