tree-pic
Generate a picture of a file's dependency tree
npm install tree-pic
Heavily inspired by pahen/madge.
Graphviz dependency
In order to generate the output image, you need to have Graphviz installed.
Mac OS X
$ sudo port install graphviz
OR
$ brew install graphviz
Ubuntu
$ sudo apt-get install graphviz
Usage
var treePic = require('tree-pic');
treePic({
filename: 'path/to/file',
directory: 'path/to/all/files',
imagePath: 'desired/path/for/generated/image.png',
requireConfig: 'path/to/requirejs/config.js',
webpackConfig: 'path/to/webpack.config.js'
})
.then(function(pathOfGeneratedImage) {
});
- Under the hood, this module uses dependency-tree to generate the tree structure, so we can take pictures of any module types (JS, Sass, Stylus) supported by that module.
License
MIT