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

@treygoff/specgate

v0.3.1

Published

NPM wrapper for Specgate CLI with a TypeScript resolution snapshot generator. Before publishing, bump version manually or use 'npm run release' which runs 'npm version patch' automatically.

Readme

specgate npm wrapper

Lightweight npm wrapper for Specgate distribution, including a focused TypeScript resolution snapshot generator that can be fed to specgate doctor compare --tsc-trace.

This README is wrapper-specific. For the main product overview, install flow, and agent-facing routing, see:

What this package provides

  • specgate wrapper binary
  • specgate-resolution-snapshot focused trace generator

The wrapper is intentionally small and self-contained. It does not assume CI-specific environment variables or secret configuration.

CLI usage

Focused snapshot generation

npx specgate-resolution-snapshot \
  --project-root . \
  --from src/app/main.ts \
  --import @core/utils \
  --out .tmp/tsc-focus.json \
  --pretty

Equivalent command through the wrapper bin (also supports snapshot-resolution alias):

npx specgate resolution-snapshot \
  --from src/app/main.ts \
  --import @core/utils \
  --out .tmp/tsc-focus.json

Feed snapshot into doctor compare

specgate doctor compare \
  --project-root . \
  --from src/app/main.ts \
  --import @core/utils \
  --structured-snapshot-in .tmp/tsc-focus.json \
  --parser-mode structured

Snapshot JSON schema (doctor_compare_tsc_resolution_focus)

The generator emits a JSON object with this shape:

{
  "schema_version": "1",
  "snapshot_kind": "doctor_compare_tsc_resolution_focus",
  "producer": "specgate-npm-wrapper",
  "generated_at": "2026-02-28T18:20:00.000Z",
  "project_root": "/abs/path/to/repo",
  "tsconfig_path": "tsconfig.json",
  "focus": {
    "from": "src/app/main.ts",
    "import_specifier": "@core/utils"
  },
  "resolutions": [
    {
      "source": "tsc_compiler_api",
      "from": "src/app/main.ts",
      "import": "@core/utils",
      "import_specifier": "@core/utils",
      "result_kind": "first_party",
      "resolved_to": "src/core/utils.ts",
      "trace": [
        "tsconfig: tsconfig.json",
        "module_resolution: NodeNext"
      ]
    }
  ],
  "edges": [
    {
      "from": "src/app/main.ts",
      "to": "src/core/utils.ts"
    }
  ]
}

result_kind is one of:

  • first_party
  • third_party
  • unresolvable

For third_party results, package_name is included when it can be inferred.

Rust parser compatibility contract

This shape is intentionally aligned to Specgate's doctor compare structured parser:

  • Any object with from + to contributes an edge.
  • Any object with from + one of import / import_specifier / specifier contributes a focused resolution record.
  • resolved_to is consumed when present.
  • result_kind is consumed when present and falls back to inference when omitted.
  • trace is consumed as an array of strings.

Because resolutions[] and edges[] are standard JSON objects using those field names, the output can be passed directly to --structured-snapshot-in.

Native specgate binary forwarding

The specgate wrapper forwards non-resolution-snapshot commands to a native binary if one is available at:

  1. SPECGATE_NATIVE_BIN (env var)
  2. npm/specgate/native/<platform>/<arch>/specgate
  3. npm/specgate/native/<platform>/specgate

If no native binary is found, the wrapper exits with an explanatory error.