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

@expgov/cli

v1.1.0

Published

Portable export-governance CLI for TypeScript SDK barrels.

Readme

License: MIT Node.js >= 20 TypeScript pnpm


Govern TypeScript SDK barrels with a single expgov.config.ts. Inventory exports, diff between refs, validate tier rules, trend release tags, trace barrel history, and map the export graph — read-only by default except init.

| Surface | URL | Role | |---------|-----|------| | Documentation | expgov.pages.dev | Install, config, commands, workflows, SDK | | GitHub | github.com/zamdevio/expgov | Source, issues, contributions |

Install

Requires Node.js >= 20.

# CLI devDependency (binary name is still `expgov`)
pnpm add -D @expgov/cli
# or: npm install -D @expgov/cli
# global CLI (optional)
pnpm add -g @expgov/cli
# or: npx expgov --help
# SDK only — programmatic run* APIs (not needed for CLI or config)
pnpm add -D @expgov/core
# or: npm install -D @expgov/core

npm packages: @expgov/cli (CLI + @expgov/cli/core config types) and @expgov/core (SDK). npm blocks the unscoped name expgov as too similar to expo — see Install.

The @expgov/cli tarball ships a self-contained CLI (dist/cli.js — core compiled in at build time). It exposes @expgov/cli/core for optional defineConfig in expgov.config.ts.

SDK first (@expgov/core)

Use the core engine when you want programmatic control — no shelling out, no Commander, no console.* in command paths.

import { runValidate } from '@expgov/core';
import {
  initProjectContext,
  setRunOptions,
  resetRunOptions,
} from '@expgov/core/internal';

initProjectContext({ cwd: process.cwd() });
setRunOptions({ json: true, quiet: true });
const exitCode = runValidate();
resetRunOptions();

Why SDK consumers pick this:

  • Same engines as the CLIrunInventory, runDiff, runValidate, runTrend, runTimeline, runGraph, and more.
  • Host-neutral — your script wires the log sink; core emits structured output or JSON envelopes.
  • Config types included@expgov/cli ships @expgov/cli/core; SDK package is for run* command APIs without the binary.
  • Stable --json contract — envelope shape matches the CLI for CI parity.

Primary references:

Why teams choose expgov

  • Governance without surprises — commands are read-only except init; tier rules live in TypeScript config you review in PRs.
  • Barrel archaeologytimeline traces commits that touched your root barrel; trend counts exports across release tags.
  • Drift visibilitydiff compares export surfaces between refs; graph maps namespaces, re-exports, and module fan-in.
  • Tier enforcement@sdkTier JSDoc plus tiers.* config buckets; validate fails on unclassified or policy violations.
  • Machine output — global --json with stable envelopes for CI and scripting.
  • Thin CLI host — Commander, chalk, and inquirer stay in packages/cli; domain logic lives in @expgov/core.

Quick start

expgov init
expgov validate
expgov inventory
expgov diff HEAD
expgov timeline @4w
expgov graph

JSON in CI:

expgov validate --json --silent
expgov inventory --json --quiet

Commands

| Command | Purpose | |---------|---------| | init | Scaffold expgov.config.ts | | inventory | Barrel snapshot — flat count, tiers, namespaces | | diff | Compare export surfaces between refs | | validate | Governance checks (exit 0/1) | | doctor | Setup hygiene — config paths, cache gitignore | | suggest | Dry-run tier allowlist hints | | trend | Export counts across release tags | | timeline | Git log of barrel edits with summary metrics | | graph | Export surface graph and analytics | | help | Command reference |

Global flags: --json, --quiet, --silent, cache, cwd, config. See CLI flags and JSON contract.

Capability matrix

| Area | Highlights | |------|------------| | Classification | @sdkTier JSDoc, nested tiers.* buckets, custom policies | | Parity | tsconfig paths ↔ npm exports checks | | Cache | Per-SHA snapshots; worktree files.json freshness gate | | Insights | Largest module, diff deltas, trend jumps on governance commands | | Ranges | Git ref ranges (A..B), time ranges (@4w), tag windows | | Automation | --json envelopes; exit codes for CI gates |

Documentation journey

| Step | Where to go | |------|-------------| | Start | Workflows · Governance | | Commands | Commands hub | | CLI | CLI overview | | SDK | SDK | | Config | Configuration |

Hosted docs: expgov.pages.dev

Repository layout

| Path | Responsibility | |------|----------------| | packages/core/ | Domain engine (run* commands, inventory, tiers, cache) | | packages/cli/ | Commander host, banners, help colorization, init prompts | | apps/docs/ | VitePress site (content synced from docs/) | | docs/ | Source-of-truth user documentation | | examples/sdk/ | Teaching fixture for tier classification | | maintainer/ | Contributor phases, agents, systems maps |

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build
node dist/cli.js validate
pnpm docs:dev       # sync + VitePress (port 8284)
pnpm docs:build
pnpm docs:deploy    # build + Cloudflare Pages (requires wrangler auth)

Dogfood config: ./expgov.config.ts at repo root.

License

MIT — see LICENSE.