Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Idea: Option to get a dependency map from Curl #133

SimplGy opened this Issue · 3 comments

2 participants


Sorry if this doesn't belong here. I'm excited about this idea.

If I could ask curl for a dependency map, and it provided me those connections maybe as a JSON object, I could auto-generate a dependency diagram every build.

This is the kind of feature that enterprises would go crazy for. Java has lots of tools for auto diagram generation, and this makes managers very happy. :)

I made these diagrams manually. They provide information sharing value. They'll break as soon as we change the code, so automation would be awesome.


Hey @SimpleAsCouldBe!

We're 100% on board with this idea! This is something we're working on right now in cram.js. In the mean time, it'd be pretty easy to hook into the getDeps "private" function in curl via a preloaded shim. Care to try something like this? (untested!)

// curlshims/depTree
define(['curl/_privileged'], function (priv) {
    var getDeps = priv.core.getDeps;
    priv.core.getDeps = function (def) {
        var deps = def.depNames, // grab dependencies
            id =; // grab id of current module
        // do something useful with these dependencies
        console.log(id, '<--', deps);
        return getDeps(def); // proceed normally

Ensure that this module is preloaded via the preloads config option: preloads: ['curlshims/depTree'].

Note that the curl/_privileged module and the getDeps function are not guaranteed to be stable, so you may have to update the shim occasionally. But since cram.js will eventually do this job, the above example is just temporary.

-- John

@unscriptable unscriptable was assigned

Hey @SimpleAsCouldBe, I'm going to close this for now. Please reopen this if/when you start working on it! -- J

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.