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

@pr-impact/core

v0.2.1

Published

PR analysis engine — breaking changes, test coverage, doc staleness, impact graphs, and risk scoring

Readme

@pr-impact/core

PR analysis engine -- detect breaking changes, map blast radius, check test coverage, find stale docs, and score risk.

Install

npm install @pr-impact/core

Quick Start

import { analyzePR, formatMarkdown, formatJSON } from '@pr-impact/core';

const analysis = await analyzePR({
  repoPath: '/path/to/repo',
  baseBranch: 'main',
  headBranch: 'feature/my-branch',
});

console.log(analysis.riskScore.score);   // 42
console.log(analysis.riskScore.level);   // "medium"
console.log(analysis.breakingChanges);   // BreakingChange[]

console.log(formatMarkdown(analysis));   // Markdown report
console.log(formatJSON(analysis));       // JSON string

Individual Analysis Steps

Each step can be used independently:

import {
  parseDiff,
  detectBreakingChanges,
  checkTestCoverage,
  checkDocStaleness,
  buildImpactGraph,
  calculateRisk,
} from '@pr-impact/core';

const repoPath = '/path/to/repo';
const base = 'main';
const head = 'HEAD';

const changedFiles = await parseDiff(repoPath, base, head);
const breakingChanges = await detectBreakingChanges(repoPath, base, head, changedFiles);
const testCoverage = await checkTestCoverage(repoPath, changedFiles);
const docStaleness = await checkDocStaleness(repoPath, changedFiles, base, head);
const impactGraph = await buildImpactGraph(repoPath, changedFiles);
const riskScore = calculateRisk(changedFiles, breakingChanges, testCoverage, docStaleness, impactGraph);

Lower-Level Utilities

import {
  categorizeFile,
  parseExports,
  diffExports,
  diffSignatures,
  mapTestFiles,
  extractImportPaths,
  findConsumers,
} from '@pr-impact/core';

categorizeFile('src/utils/auth.ts');       // 'source'
categorizeFile('__tests__/auth.test.ts');  // 'test'
categorizeFile('README.md');               // 'doc'

Types

All TypeScript interfaces are exported from the package:

import type {
  PRAnalysis,
  AnalysisOptions,
  ChangedFile,
  BreakingChange,
  TestCoverageReport,
  TestCoverageGap,
  DocStalenessReport,
  StaleReference,
  ImpactGraph,
  ImpactEdge,
  RiskAssessment,
  RiskFactor,
  ExportedSymbol,
  FileExports,
} from '@pr-impact/core';

Risk Score

The risk score is a weighted average of six factors (0--100):

| Factor | Weight | Description | |---|---|---| | Breaking changes | 0.30 | Severity of detected breaking API changes | | Untested changes | 0.25 | Ratio of changed source files lacking test updates | | Diff size | 0.15 | Total lines added + deleted | | Stale documentation | 0.10 | References to modified/removed symbols in docs | | Config file changes | 0.10 | CI/build config modifications | | Impact breadth | 0.10 | Number of indirectly affected files |

Risk levels: Low (0--25), Medium (26--50), High (51--75), Critical (76--100).

Requirements

  • Node.js >= 20
  • Must be run inside a git repository (uses simple-git for git operations)

License

MIT