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

@phoenixaihub/blastradius

v1.0.0

Published

Change Impact Predictor — quantifies the risk of deploying code changes using static call graph analysis and PageRank-style risk propagation

Readme

🔥 blastradius

Change Impact Predictor — quantifies the risk of deploying code changes using static call graph analysis and PageRank-style risk propagation.

The Problem

Before deploying a code change, you need to know: what could break?

A one-line change to a utility function might affect 47 transitive callers across 12 API endpoints handling 2M daily requests. Or it might affect nothing. blastradius tells you which.

How It Works

  1. Static Call Graph — Parses JS/TS/Python source to build a function-level call graph
  2. Runtime Traces (optional) — Ingests OpenTelemetry trace JSON for real call frequencies
  3. Transitive Impact — BFS from changed functions through the reverse call graph
  4. PageRank Risk Propagation — Changed functions start with base risk, propagated to callers weighted by edge frequency
  5. Risk Scoring — 0-100 scale: traffic volume × depth of impact × affected entry points
  6. Entry Point Classification — Detects API endpoints, event handlers, cron jobs, CLI commands

Install

npm install -g @phoenixaihub/blastradius

CLI Usage

# Analyze specific changed files
blastradius analyze ./src --changed src/payments.ts src/auth.ts

# Analyze from git diff
git diff HEAD~1 | blastradius analyze ./src --diff -

# With OpenTelemetry runtime traces
blastradius analyze ./src --changed src/api.ts --trace traces.json

# JSON output
blastradius analyze ./src --changed src/payments.ts --json

Programmatic API

import { analyze } from '@phoenixaihub/blastradius';

const result = analyze('./src', {
  changedFiles: ['src/payments.ts'],
  tracePath: './traces.json', // optional
});

console.log(result);
// {
//   changed_functions: 4,
//   risk_score: 87,
//   risk_level: "high",
//   impacts: [{ function: "processPayment", risk: 92, ... }],
//   safe_changes: ["src/utils.ts:formatDate — no callers affected"]
// }

Output Format

{
  "changed_functions": 4,
  "risk_score": 87,
  "risk_level": "high",
  "impacts": [
    {
      "function": "processPayment",
      "file": "src/payments.ts",
      "direct_callers": 3,
      "transitive_callers": 47,
      "affected_endpoints": ["/api/checkout", "/api/subscription"],
      "estimated_daily_calls": 2100000,
      "risk": 92,
      "recommendation": "staging + canary deployment recommended"
    }
  ],
  "safe_changes": ["src/utils/format.ts:formatDate — no callers affected"]
}

Risk Levels

| Score | Level | Action | |-------|-------|--------| | 0-29 | Low | Standard deployment | | 30-59 | Medium | Standard testing, monitor after deploy | | 60-79 | High | Thorough testing + staged rollout | | 80-100 | Critical | Staging + canary deployment |

Algorithm Details

PageRank-Style Risk Propagation

Each changed function starts with a base risk of 1.0. Risk propagates through the call graph:

risk(node) = base_risk + damping × Σ(callee_risk × edge_frequency / total_frequency)

After convergence (10 iterations, damping factor 0.85), high-traffic paths through changed code accumulate the highest risk scores.

Risk Score Components

  • Depth score (30%): min(transitive_callers / 50, 1)
  • Endpoint score (25%): min(affected_endpoints / 5, 1)
  • Traffic score (25%): min(daily_calls / 1M, 1)
  • PageRank score (20%): Normalized propagated risk

OpenTelemetry Integration

Export traces as JSON and feed them in for frequency-weighted analysis:

# Export traces from your collector
otel-cli export --format json > traces.json

# Analyze with real traffic data
blastradius analyze ./src --changed src/api.ts --trace traces.json

Supported trace format: OpenTelemetry JSON with resourceSpans or flat spans array.

Supported Languages

  • JavaScript (.js, .mjs, .cjs)
  • TypeScript (.ts, .tsx)
  • Python (.py)

License

MIT