pahen / madge

Create graphs from your CommonJS, AMD or ES6 module dependencies
MIT License
9.01k stars 319 forks source link

Enhancement: output image to stdout #185

Open zypA13510 opened 5 years ago

zypA13510 commented 5 years ago

While I want to check the dependency graph, sometimes it's undesirable to actually create an image file on disk (e.g. within a git repository, I have to exclude it from being committed)

At the moment, I can run the following one-liner:

madge --dot . | dot -Tsvg | display

However, as noted in #22, the output from dot and image are different (no color on dot version, and the direction is also different). I find myself prefer the image version better, but I cannot view it without creating the file on disk. It would be nice if this can be added.

kyrisu commented 3 years ago

One solution to the above is to use process substitution. You will need to have it supported by your shell (Bash, Zsh, Ksh) but if you do, you can run:

madge --image >(feh -) .

where feh is Linux image viewer.