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

@blacnova/dep-insight

v1.0.2

Published

Interactive dependency visualization and impact analysis for JavaScript projects

Readme

@blacnova/dep-insight

Interactive dependency visualization and impact analysis for JavaScript projects.

Features

  • Build dependency graphs from package.json and ES6 imports
  • Detect circular dependencies
  • Impact analysis: "if I change this file, what breaks?"
  • Dependency health scoring (outdated, unmaintained packages)
  • Interactive console visualization with console-grid
  • Interactive HTML visualization with impact analysis
  • Zero runtime dependencies (except acorn for parsing)
  • TypeScript support
  • ESM and CommonJS dual format

Install

npm i @blacnova/dep-insight

Usage

CommonJS

const DepInsight = require("@blacnova/dep-insight");

ESM

import DepInsight from "@blacnova/dep-insight";
// or
import DepInsight, { DepInsight as DepInsightClass } from "@blacnova/dep-insight";

Examples

Basic Analysis

const DepInsight = require("@blacnova/dep-insight");

const di = new DepInsight({
    rootDir: './my-project',
    includeDev: false,
    includePeer: false
});

// Build the dependency graph
await di.build();

// Detect circular dependencies
const circular = di.detectCircular();
console.log(`Found ${circular.length} circular dependencies`);

// Score dependency health
const healthScores = await di.scoreHealth();

// Generate console report
di.reportConsole();

Impact Analysis

const DepInsight = require("@blacnova/dep-insight");

const di = new DepInsight();
await di.build();

// Analyze impact of changing a specific file
const impact = di.analyzeImpact('src/utils/helpers.js');

console.log(`Impact Level: ${impact.impact.level}`);
console.log(`Direct Dependents: ${impact.directDependents.length}`);
console.log(`Transitive Dependents: ${impact.transitiveDependents.length}`);
console.log('Recommendations:', impact.recommendations);

Generate HTML Report

const DepInsight = require("@blacnova/dep-insight");

const di = new DepInsight();
await di.build();
di.detectCircular();
await di.scoreHealth();

// Generate interactive HTML report
const reportPath = await di.reportHtml('./dependency-report.html');
console.log(`Report generated: ${reportPath}`);

Complete Analysis

const DepInsight = require("@blacnova/dep-insight");

const di = new DepInsight();

// Run complete analysis
const results = await di.analyze();

console.log('Graph:', results.graph);
console.log('Circular Dependencies:', results.circularDependencies);
console.log('Health Scores:', results.healthScores);

API

new DepInsight(options)

Creates a new DepInsight instance.

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | rootDir | string | process.cwd() | Root directory to analyze | | includeDev | boolean | false | Include dev dependencies | | includePeer | boolean | false | Include peer dependencies | | maxDepth | number | 10 | Maximum depth for dependency traversal |

Methods

build(): Promise<DependencyGraph>

Build the dependency graph from package.json and source files.

detectCircular(): string[][]

Detect circular dependencies in the graph. Returns an array of cycles, where each cycle is an array of node IDs.

analyzeImpact(filePath): ImpactResult

Analyze the impact of changing a specific file.

scoreHealth(): Promise<Map<string, HealthScore>>

Score the health of all dependencies based on npm registry data.

reportConsole(): string[]

Generate a console report using console-grid.

reportHtml(outputPath?: string): Promise<string>

Generate an interactive HTML report.

analyze(): Promise<AnalysisResult>

Run complete analysis (build, circular detection, health scoring).

Console Report Example

=== Dependency Graph Summary ===
┌─────────────────────────┬──────────┐
│ Metric                  │ Value    │
├─────────────────────────┼──────────┤
│ Total Files             │ 45       │
│ Total Packages          │ 12       │
│ Total Dependencies      │ 67       │
│ Circular Dependencies   │ 2        │
└─────────────────────────┴──────────┘

=== Circular Dependencies ===
Found 2 circular dependency cycle(s)
┌────────┬──────────────────────────────────┐
│ Cycle  │ Path                             │
├────────┼──────────────────────────────────┤
│ Cycle1 │ src/a.js → src/b.js → src/a.js   │
│ Cycle2 │ src/x.js → src/y.js → src/x.js   │
└────────┴──────────────────────────────────┘

=== Dependency Health Scores ===
┌─────────────────┬──────────────┬───────┬───────┐
│ Package         │ Version      │ Grade │ Score │
├─────────────────┼──────────────┼───────┼───────┤
│ lodash          │ 4.17.21      │ A     │  95   │
│ express         │ 4.18.2       │ B     │  82   │
│ outdated-pkg    │ 1.0.0        │ F     │  45   │
└─────────────────┴──────────────┴───────┴───────┘

HTML Report Features

The HTML report includes:

  • Summary Tab: Overview of dependency metrics
  • Graph Tab: Interactive dependency graph visualization
  • Circular Dependencies Tab: List of all circular dependency cycles
  • Health Scores Tab: Detailed health scores for each dependency
  • Impact Analysis Tab: Interactive tool to analyze impact of file changes

Health Scoring

Dependency health is scored based on:

  • Outdated versions: Major/minor/patch updates available
  • Maintenance: How recently the package was updated
  • Deprecation: Whether the package is marked as deprecated
  • Age: Package maturity (new vs established packages)

Scores range from 0-100 with letter grades:

  • A (90-100): Excellent health
  • B (80-89): Good health
  • C (70-79): Fair health
  • D (60-69): Poor health
  • F (0-59): Critical health

Impact Analysis Levels

  • Low: Changes affect few files, minimal risk
  • Medium: Changes affect multiple files, moderate risk
  • High: Changes affect many files, high risk
  • Critical: Changes affect large portions of codebase, very high risk

Circular Dependency Detection

Uses depth-first search (DFS) to detect cycles in the dependency graph. Each cycle is reported with the full path of dependencies.

License

MIT