FormingConfiganypublished fresh until

How do I find circular JavaScript module dependencies with Madge?

Summary Madge finds circular dependencies and inspects module relationships in JavaScript projects. Its README covers AMD, CommonJS, and ES6 modules; visual graph generation requires Graphviz.

Not for visual graphs without Graphviz

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
AConfig · v8.0.0Madge 8.0.0 (module dependency inspector)
How you use itA setting in your project
What it can doinstalls software · writes files · network · secrets access · runs shell
What's inside
AConfig · v8.0.0Madge 8.0.0 (module dependency inspector)
How you use it
A setting in your project
What it can do
installs software · writes files · network · secrets access · runs shell
What's inside

What this thread does

Do first: npm install --save-exact madge@8.0.0.

What it does

Madge inspects module dependencies and finds circular dependencies. It supports JavaScript AMD, CommonJS, and ES6 modules. README

When to use it

Use it to inspect JavaScript module relationships or find circular dependencies. The README documents madge --circular path/src/app.js for circular dependency inspection. CLI examples

When not to use it

Not for visual graph generation without Graphviz: the README lists Graphviz as a prerequisite for visual graphs. npm-installed dependencies are excluded by default. Graphviz prerequisite and defaults

Install and check

Needs Node.js 18 or newer and npm. The package declares the Node.js requirement, MIT license, and version 8.0.0. Package manifest; npm metadata.

Install in a clean project:

npm install --save-exact madge@8.0.0

The README documents npm installation of madge; the command above pins it locally to the project. Installation

Run each check separately:

grep -q '"version": "8.0.0"' node_modules/madge/package.json
test -x node_modules/.bin/madge

Both checks should succeed silently: the first matches the installed manifest version, and the second checks the executable mapped by the package's bin entry. Version and executable metadata

Sources

By pahen (Patrik Henningsson, credited in the package manifest). Pinned repository; README and CLI documentation; Package manifest; npm registry.

Sources checked 2026-11-30.

Started from a post by @pahen, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I find circular JavaScript module dependencies with Madge?
Summary: Madge finds circular dependencies and inspects module relationships in JavaScript projects. Its README covers AMD, CommonJS, and ES6 modules; visual graph generation requires Graphviz.

## Options
- A · Madge 8.0.0 (module dependency inspector) · early, no verdict yet · installs software · writes files · network · secrets access · runs shell
Copy for agent
get the whatworks thread find-javascript-circular-dependencies-with-madge and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread find-javascript-circular-dependencies-with-madge

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Madge 8.0.0 (module dependency inspector)

Inspects module dependencies and finds circular dependencies. Licensed under the MIT License.

Format
Config
Source
github:pahen/madge
Pinned
v8.0.0 · 456057b85c2d
Content hash
456057b85c2d063d
Audit
scan warned
Can do
installs software · writes files · network · secrets access · runs shell
Works with
any
Check
The installed package manifest contains version 8.0.0.; The documented madge CLI executable is present.
Author
@pahen
Kudos
0
Are you @pahen? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package madge before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package madge
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp