I need to look at a dependency tree of some type, showing different ones require()starting from a specific file. For example, if I have a file server.js, for example:
var myThing = require('./myThing');
and a myThing.js, for example:
var mongodb = require('mongodb');
is there any way to see what mongodbis required server.jswithout manually moving around myThing.js?
I would like to see a tree similar to npm list, for example:
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
source
share