Skip to content

Draw dependency graph for typescript or javascript modules

Notifications You must be signed in to change notification settings

alan-khosro/imports-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imports-graph

Draw dependency graph for typescript or javascript modules

Install

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

Usage

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.

Output dot notation to stdio/terminal

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

Generate .svg file

deno run -A jsr:@invisement/imports-graph@^1 . | dot -Tsvg > ./documentation/ui-imports-graph.svg

Import

import { toDot } from "jsr:@invisement/imports-graph";

You may want to use it with viz.js to create the svg file for your webpage.

About

Draw dependency graph for typescript or javascript modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published