Is there an NPM module that can show the dependencies between individual JS files within a module?
Suppose I have 20 JS files in my own NPM module; I'd like to see the dependency tree between my 20 JS files.
Some tools are available to graph the obvious dependencies (the ones you can guess from a static analysis).
See for example MaDGe - Module Dependency Graph
require()statement. Simply following them recursively is a relatively trivial problem. I'm also excluding dependencies from package.json, e.g,require('some-module-from-npmjs.org')will be thrown away whereasrequire('./utils/calculator.js')will be followed.let randomModule = require(names[Math.random()*names.length|0]);. Or something more useful but still dynamic. Of course there are some obvious dependencies, but, but also non obvious ones.require()statements are fully "knowable":require('./util/calculator.js').