Make module.parent available. #323

wants to merge 1 commit into


None yet

5 participants

Gozala commented Mar 12, 2013

Fix for #318


This is very confusing. The wrapper/ stuff isn't even in v2 anymore since all of this is handled by browser-pack now.

@michaelficarra michaelficarra added a commit to michaelficarra/commonjs-everywhere that referenced this pull request Mar 12, 2013
@michaelficarra michaelficarra support module.parent; based on substack/node-browserify#323 d90a6b3
pmuellr commented Mar 15, 2013

It would certainly be nice to have the complete module spec available, eg loaded, parent, and children.

I haven't yet done so for node, but for ancient module runtimes I've written in the past, I've made use of this information to do some visualization.

There is also a similar, but slightly different "tree" shape available, at the you run browserify. Would be nice to have that tree available as well, presumably in a separate JSON file:


    "foo": {
        "children": ["bar", "baz"]
    "bar": {
        "children": []
    "foo": {
        "children": []

@pmuellr: module.children support is really easy (michaelficarra/commonjs-everywhere@5179659), especially after you support module.parent (michaelficarra/commonjs-everywhere@d90a6b3).


This should be implemented as a separate browser-pack module.


Now in 3.7.0 you can specify a custom opts.pack to browserify() so using a custom browser-pack implementation for this is much more feasible.

@substack substack closed this Dec 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment