Skip to content
xevrionPublic

About

Smart dependency auditor and graph visualizer for Node.js and Python projects

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

depgraph

Smart dependency auditor and graph visualizer for Node.js and Python projects.

Features

  • Parses package.json, requirements.txt, and pyproject.toml
  • Builds a directed in-memory dependency graph
  • Detects cycles (Tarjan's SCC algorithm)
  • Finds unused dependencies by scanning source imports
  • Detects version conflicts across the graph
  • Classifies licenses (permissive / copyleft / unknown)
  • Outputs: colored terminal tree, JSON, self-contained HTML report

Install

npm install -g .

Or with Docker:

docker build -t depgraph .
docker run --rm -v $(pwd):/project depgraph analyze /project

Usage

# Analyze a Node.js project and show the terminal tree
depgraph analyze ./my-app

# Find all dependency cycles
depgraph cycles ./my-app

# List unused declared dependencies
depgraph unused ./my-app

# Generate reports
depgraph report ./my-app --format terminal
depgraph report ./my-app --format json -o report.json
depgraph report ./my-app --format html -o report.html

# Show license breakdown
depgraph licenses ./my-app

Output formats

Terminal tree (default)

my-app@1.0.0
├── chalk@^5.3.0 [dep]
├── commander@^12.1.0 [dep]
│   └── ...
└── vitest@^1.0.0 [dev]

JSON (--format json)

{
  "schemaVersion": "1.0.0",
  "generatedAt": "2025-03-15T10:00:00.000Z",
  "graph": { "nodeCount": 42, "edgeCount": 67, "nodes": [...], "edges": [...] },
  "analysis": {
    "cycles": [],
    "unusedDeps": ["moment"],
    "conflicts": [],
    "licenses": [...]
  }
}

HTML (--format html)

A self-contained single-file report with a collapsible dependency tree, cycle warnings, and license table. No external CDN dependencies.

Development

npm install
npm run build
npm test

Supported manifests

File Ecosystem
package.json Node.js (deps, devDeps, peerDeps)
requirements.txt Python (PEP 508 constraints)
pyproject.toml Python (PEP 621 + Poetry)

License

MIT

About

Smart dependency auditor and graph visualizer for Node.js and Python projects

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages