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

@anjuvenu2005/impact-analyzer

v3.0.0

Published

Diff-aware and simulation-first CLI for dependency impact analysis

Readme

Code Impact Analyzer

Developer-first CLI to predict blast radius from real diffs or simulated file changes.

It builds a dependency graph, traverses reverse dependencies, scores impacted files, and explains why each file is affected.

Features

  • Diff-aware analysis (HEAD~1, staged, commit range)
  • Simulation mode before making changes (check)
  • Impact scoring with risk levels (HIGH, MEDIUM, LOW)
  • Explainability (--why) and source-line insights (--code)
  • Policy gates for CI (criticalPaths, risk threshold, owners)
  • Incremental cache for faster repeated runs
  • Forecast/validation loop with precision/recall/F1 metrics

Install

npm install

Quickstart

# Simulate impact before editing code
impact-analyzer check src/auth.ts --why

# Analyze actual repo changes
impact-analyzer analyze --staged --why

# Export machine-readable artifacts
impact-analyzer analyze --export output --output both

Commands

impact-analyzer analyze [--commit <ref> | --staged] [options]
impact-analyzer check <file...> [--targets <csv>] [options]
impact-analyzer graph [file] [--depth <n>]
impact-analyzer focus <file>
impact-analyzer interactive
impact-analyzer metrics

Common options:

  • --output cli|json|both
  • --report-file <path>
  • --export [dir]
  • --why
  • --code
  • --depth <n> / --max-depth <n>
  • --risk HIGH|MEDIUM|LOW
  • --fast
  • --record-forecast
  • --validate-latest
  • --ci
  • --ci-threshold <risk>
  • --no-cache
  • --cache-file <path>

Config

Create impact.config.json in target repo root:

{
  "ignore": ["node_modules", ".git", "tests"],
  "extensions": [".js", ".ts", ".jsx", ".tsx"],
  "cache": {
    "enabled": true,
    "file": ".impact-cache.json"
  },
  "policies": {
    "criticalPaths": ["src/payments/**", "src/auth/**"],
    "owners": {
      "src/auth/**": "@security-team",
      "src/**": "@app-team"
    },
    "ci": {
      "failOnRisk": "HIGH",
      "failOnCritical": true
    }
  },
  "validation": {
    "forecastsFile": ".impact-forecasts.jsonl",
    "metricsFile": ".impact-validation.jsonl"
  }
}

Create Repo and Push

cd /home/anj/impact-analyzer
git init
git add .
git commit -m "feat: production-ready code impact analyzer"
git branch -M main
git remote add origin <YOUR_GITHUB_REPO_URL>
git push -u origin main

Deployment

CI

/.github/workflows/ci.yml runs:

  • dependency install
  • syntax check
  • smoke test
  • package dry-run

NPM Publish

/.github/workflows/publish-npm.yml publishes on GitHub Release or manual dispatch.

Required GitHub repo secret:

  • NPM_TOKEN (from npm access token)

Optional release flow:

npm version patch
git push --follow-tags
# create GitHub Release for the new tag

Architecture

  • src/cli: command orchestration
  • src/git: git integration
  • src/scanner: file discovery
  • src/resolution: ts/js alias + workspace resolver
  • src/parser: AST-first dependency extraction
  • src/cache: incremental parse cache
  • src/graph: dependency and reverse graph
  • src/analysis: impact traversal + scoring
  • src/policy: ownership and CI policy evaluation
  • src/metrics: forecast validation metrics
  • src/output: CLI and JSON formatting

License

MIT