jriecken / dependency-graph

A simple dependency graph for Node.js
http://jriecken.github.io/dependency-graph/
MIT License
330 stars 49 forks source link

print tree function / expose the DFS function #4

Closed vjpr closed 9 years ago

vjpr commented 9 years ago

I would like to print all my dependencies a la npm ls.

jriecken commented 9 years ago

A dependency graph is a Directed Acyclic Graph, not a Tree and so is more complicated to draw than a directory tree.

I'm not entirely sure what the output would look like (I don't want to have to write a graph visualization/layout tool :smile:) - Would need something more complex than just a hook into DFS to output the graph.

There are graph visualization tools that could be helpful - E.g:

vjpr commented 9 years ago

What I meant was something like this from npm ls:

├── ajax@0.0.4
├── app-module-path@1.0.2
├── architect@0.1.11
├── autobind-decorator@1.2.0
├─┬ autoprefixer-loader@1.2.0
│ ├─┬ autoprefixer-core@5.2.0
│ │ ├── browserslist@0.4.0
│ │ ├── caniuse-db@1.0.30000212
│ │ ├── num2fraction@1.1.0
│ │ └─┬ postcss@4.1.11
│ │   ├── es6-promise@2.1.1
│ │   ├── js-base64@2.1.8
│ │   └─┬ source-map@0.4.2
│ │     └── amdefine@0.1.1
│ └─┬ loader-utils@0.2.10
│   ├── big.js@3.1.3
│   └── json5@0.4.0