Skip to content

Instantly share code, notes, and snippets.

@pmuellr
Created April 23, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmuellr/11227416 to your computer and use it in GitHub Desktop.
Save pmuellr/11227416 to your computer and use it in GitHub Desktop.
var path = require("path")
setTimeout(printModules, 2000)
function printModules(mod, indent, root) {
if (!mod) mod = module
if (!indent) indent = ""
if (!root) root = path.dirname(mod.filename)
modName = path.relative(root, mod.filename)
console.log(indent + modName)
for (var i=0; i<mod.children.length; i++) {
printModules(mod.children[i], indent + " ", root)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment