javascript - How can I see the full nodejs "require()" tree starting at a given file? -


i need view dependency tree of sort, showing various require()s starting @ particular file. example, if have server.js file so:

// server.js var mything = require('./mything'); 

and mything.js file so:

// mythings.js var mongodb = require('mongodb'); 

is there way see mongodb required server.js without manually traversing through mything.js ?

i'd love see tree npm list generates, eg:

alex@alex-pc ~/repos/test $ npm list test@1.0.0 /home/alex/repos/test ├─┬ gulp@3.8.11 │ ├── archy@1.0.0 │ ├─┬ chalk@0.5.1 │ │ ├── ansi-styles@1.1.0 │ │ ├── escape-string-regexp@1.0.3 │ │ ├─┬ has-ansi@0.1.0 │ │ │ └── ansi-regex@0.2.1 │ │ ├─┬ strip-ansi@0.3.0 │ │ │ └── ansi-regex@0.2.1 │ │ └── supports-color@0.2.0 │ ├── deprecated@0.0.1 

you can see dependency tree using madge


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -