Update: grunt-dependencygraph has been replaced by dependo - a more modular version, wrapped up as a NPM-package with both an API, CLI and Grunt task.
More importantly I also wanted to gain a better overview of the dependencies in our code, by being able to extract the module definitions and their dependencies in a systematic way. Using AMD has enabled this in a simple way, because much of the tooling already existed.
Okay, I found a few, but they use GraphViz, or similar, to generate huge images that is impossible to handle when you generate a graph of a larger code-base.
I want something better. Something similar to Google Maps, where you have a big graph that’s zoomable by mouse or gestures, combined with dragging, to enable panning when the graph is zoomed. I haven’t been able to find something like this, so I’ve taken the write it myself.
It’s all wrapped up as a simple node-module, available on NPM, with both an API and CLI. I also written a grunt-task that can be found here grunt-dependo, so it’s convenient to hook into your grunt-build system. The output is a simple HTML-file, with everything embedded, so you can publish it directly to your build server, etc.
Example: RequireJS multi-page visualization
Enough talk. The best way to show something is by example, so here I generated a graph of the official RequireJS multipage example:
It’s still early days, but I think this tool will help developers getting a better overview of modules and their dependencies. I really hope you like this tool too.
Have an good idea, or wanna contribute? All feedback is highly appricated.