dep-analysis
v1.1.0
Published
A tool to analyze and visualize imports and call relationships
Maintainers
Readme
dep-analysis
A powerful tool to analyze and visualize dependencies between files in TypeScript/JavaScript projects
Features
- Analyze imports and function calls between files
- Generate dependency graphs in multiple formats (JSON, D3, DOT, HTML)
- Interactive HTML visualization with D3.js
- Detect circular dependencies
- Find most imported files
- Support for both TypeScript and JavaScript projects
Install
npm install dep-analysisUsage
Usage: dep [options]
Options:
-V, --version output the version number
-g, --glob <pattern> glob pattern to match files (required)
-l, --language <language> language to analyze (ts or js) (required)
-o, --output <file> output file for the graph
-f, --format <format> output format (json, d3, dot, html)
--open open the HTML visualization in browser (only works with html format)
Examples:
# Analyze TypeScript files and generate HTML visualization
$ dep --glob "src/**/*.ts" --language ts --output graph.html --format html --open
# Analyze JavaScript files and output JSON
$ dep --glob "src/**/*.js" --language js --output dependencies.json --format jsonExample Output
The tool provides a detailed analysis of your codebase, including:
- Total number of files analyzed
- Import dependencies between files
- Function call relationships
- Circular dependencies (if any)
- Most imported files
The HTML visualization provides an interactive graph where you can:
- Zoom and pan
- Click on nodes to see details
- Hover over edges to see relationship types
- Search for specific files or functions
