# pahen/madge

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pahen-madge).**

10,117 stars · 348 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/pahen/madge
- awesome-repositories: https://awesome-repositories.com/repository/pahen-madge.md

## Topics

`amd` `commonjs` `dependencies` `es6` `graph` `graphviz` `less` `madge` `sass` `stylus`

## Description

Madge is a JavaScript module dependency visualizer and architecture mapper. It analyzes source code to create graphs and diagrams of module relationships, supporting CommonJS, AMD, and ES6 standards.

The tool functions as a circular dependency detector to identify recursive import loops and a dependency graph generator that exports relationship maps into image and vector formats. It provides utilities for auditing project structure, including the identification of orphaned modules and leaf modules.

Its broader capabilities include dead code identification, module impact analysis through dependent tracing, and software architecture visualization. These analyses are performed via static parsing of source files without executing the code.

Analysis settings and scanning behavior can be automated through configuration in a project metadata file.

## Tags

### Software Engineering & Architecture

- [Module Dependency Analysis](https://awesome-repositories.com/f/software-engineering-architecture/static-analysis/module-dependency-analysis.md) — Performs static analysis of module graphs to identify imports and require statements without executing the code.
- [Visualizations](https://awesome-repositories.com/f/software-engineering-architecture/static-analysis/module-dependency-analysis/visualizations.md) — Creates visual graphs and diagrams of module relationships for CommonJS, AMD, and ES6 source code.
- [Abstract Syntax Tree Parsing](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing.md) — Provides abstract syntax tree parsing of source files to reliably identify dependency declarations across various JavaScript module standards.
- [Dependency Graph Visualizations](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-visualizations.md) — Provides tools for mapping and exporting software module relationships into visual image and vector formats.
- [Dependency Tree Traversers](https://awesome-repositories.com/f/software-engineering-architecture/recursive-validation-engines/recursive-tree-traversers/dependency-tree-traversers.md) — Implements recursive traversal of the module tree to discover all transitive dependencies starting from a root file.
- [Architecture Visualizers](https://awesome-repositories.com/f/software-engineering-architecture/static-analysis-engines/architecture-visualizers.md) — Performs static analysis to generate visual maps of codebase structure and component dependencies.
- [Leaf Module Identification](https://awesome-repositories.com/f/software-engineering-architecture/static-analysis/module-dependency-analysis/leaf-module-identification.md) — Lists files that do not import any other dependencies, marking the terminal points of dependency chains. ([source](https://github.com/pahen/madge/blob/master/README.md))
- [Orphaned Module Detection](https://awesome-repositories.com/f/software-engineering-architecture/static-analysis/module-dependency-analysis/orphaned-module-detection.md) — Identifies files that are not imported or required by any other part of the application to find unused code. ([source](https://github.com/pahen/madge/blob/master/README.md))

### Development Tools & Productivity

- [Circular Dependency Detectors](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/code-dependency-analysis/unused-dependency-identification/duplicate-dependency-detectors/circular-dependency-detectors.md) — Provides a scanner that identifies recursive module import loops to help developers break dependency chains.
- [Dead Code Elimination](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination.md) — Locates orphaned or unused modules that are no longer imported by any other part of the application.
- [Change Impact Analysis](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/change-impact-analysis.md) — Traces all modules that import a specific file to determine the impact of architectural changes. ([source](https://github.com/pahen/madge/blob/master/README.md))
- [Graphviz DOT Emitters](https://awesome-repositories.com/f/development-tools-productivity/graphviz-dot-emitters.md) — Converts internal dependency data into the Graphviz DOT language for rendering as images or vector graphics.

### DevOps & Infrastructure

- [Module Dependency Graphs](https://awesome-repositories.com/f/devops-infrastructure/dependency-graph-engines/module-dependency-graphs.md) — Models modules as nodes and imports as edges in a directed graph to calculate connectivity and detect recursive loops.
