GitDiagram
Browse

GitDiagram vs Madge: architecture overview or module graph

Written by GitDiagram. Facts about Madge checked against its own docs on (sources).

Madge draws a graph of a JavaScript project's module dependencies and finds circular imports, from one command on your own machine. GitDiagram gives an AI-made overview of the main parts of any GitHub repository, in any language, with nothing to install. Choose Madge for a quick, exact look at which file imports which, or a circular-dependency check; choose GitDiagram to understand what a repository's parts do and how they connect. Note that Madge's last release, 8.0.0, came out in August 2024; for rules enforced in CI, dependency-cruiser is the actively maintained choice.

Which to choose

Choose Madge whenChoose GitDiagram when
You want to see exactly which file imports which.You want the main components and what they do, not every file.
You want a fast circular-dependency check (madge --circular).The repository is not JavaScript.
You want orphan or leaf modules listed.You don't want to clone or install anything.
The code must stay on your machine.You want a diagram that stays readable for a large project.

The same repository in both

We ran Madge 8.0.0 on Express's lib folder (commit 43fca52, 2026-11-02) on 2026-11-09. madge --circular lib processed 6 files and printed "No circular dependency found!"; the 28 warnings were the npm packages it skips. madge --json lib gave the file graph:

npx madge --json lib
{
  "application.js": ["utils.js", "view.js"],
  "express.js": ["application.js", "request.js", "response.js"],
  "request.js": [],
  "response.js": ["utils.js"],
  "utils.js": [],
  "view.js": []
}

What GitDiagram shows for it

GitDiagram's Express diagram has 16 components in 5 groups with 21 labeled connections, including the parts Express works with that Madge leaves out: Node's HTTP server, the router package, template engines, the filesystem and the final error handler. Madge's graph is exact; GitDiagram's is an AI interpretation of what matters.

What Madge does

Madge is "a developer tool for generating a visual graph of your module dependencies, finding circular dependencies, and giving you other useful info". It reads JavaScript as AMD, CommonJS and ES modules, plus Sass, Stylus and Less, and TypeScript with --extensions ts and --ts-config. Run npx madge --image graph.svg src/ for a picture (Graphviz needed), or --json, --dot, --circular, --orphans and --leaves for text. --circular exits with code 1 when it finds a cycle, so it works as a simple CI check; there is no rule engine beyond that.

It is MIT licensed with about 10,000 GitHub stars. By default it scans only .js files, skipped files are reported only with --warning, and its own FAQ says images of big graphs are hard to read.

What GitDiagram does

Replace hub with diagram in a GitHub URL. An AI model reads the file tree, README and up to 12 source files and draws the main components, each linked to its code.

GitDiagram's limits: it is a map of the important parts, not a complete dependency graph. It can simplify or leave things out, it works only with GitHub repositories, and it shows the repository as it was when the diagram was made (Regenerate makes a fresh one).

At a glance

QuestionGitDiagramMadge
What you getOne interactive architecture diagram: up to 34 main components in groups, with labeled connections and a written overview. Each component links to its file or folder on GitHub.A file-by-file dependency graph (image, dot or JSON) and lists of circular, orphan and leaf modules.
LanguagesAny language in a GitHub repository.JavaScript and TypeScript, plus Sass, Stylus and Less.
SetupNone. Replace hub with diagram in a GitHub URL, or paste the URL on the home page.npm install -g madge or npx madge; Graphviz for images.
Private codeYes, with a fine-grained GitHub token that stays in your browser and is never saved on GitDiagram's servers.Yes: it runs locally.
PriceFree. Making new diagrams is free within a shared daily limit; after that you can add your own OpenAI API key.Free, MIT. Last release 8.0.0, August 2024.

Questions

How do I check a JavaScript project for circular dependencies?

Run npx madge --circular src/ (add --extensions ts for TypeScript). It lists each cycle and exits with code 1 if there is one.

Is Madge still maintained?

Its latest release on npm is 8.0.0, from 2024-08-05, which is also the last commit on its main branch as of 2026-11-09. It still works for many projects; dependency-cruiser is the actively released alternative.

Sources

Checked on . Products change: if something here is out of date, open an issue.