Draw dependency graph for typescript or javascript modules
Download the file (imports-graph.ts) or git clone the repo or imports from JSR or just use the direct url: jsr:@invisement/imports-graph@^1
deno run --allow-read=<dir> --allow-run=git jsr:@invisement/imports-graph@^1 <dir>
- It creates the imports inter-dependency of your TS and JS (ESM) modules and dumps its DOT notation to
stdio
/terminal. <dir>
is the root of the directory to find all TS files (recursively). If not provided, it uses current directory.- If you run it from a git repo, it respects your .gitignore.
deno run -A jsr:@invisement/imports-graph@^1 ./ui
or you can pipe it to clipboard and paste it in an online graph viewer
deno run -A jsr:@invisement/imports-graph@^1 ./ui | pbcopy
- install dot graphviz: https://graphviz.org/doc/info/command.html.
deno run -A jsr:@invisement/imports-graph@^1 . | dot -Tsvg > ./documentation/ui-imports-graph.svg
import { toDot } from "jsr:@invisement/imports-graph";
You may want to use it with viz.js to create the svg file for your webpage.