npm.io
1.0.1 • Published 10 years ago

tree-pic

Licence
MIT
Version
1.0.1
Deps
4
Vulns
0
Weekly
0

tree-pic npm npm

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',
  // optional
  imagePath: 'desired/path/for/generated/image.png',
  requireConfig: 'path/to/requirejs/config.js',
  webpackConfig: 'path/to/webpack.config.js'
})
.then(function(pathOfGeneratedImage) {
  // At this point, the image was already created
});
  • 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

Keywords