{"id":21655186,"url":"https://github.com/pseitz/ts-dependency-graph","last_synced_at":"2025-04-04T18:04:43.506Z","repository":{"id":39700485,"uuid":"276293508","full_name":"PSeitz/ts-dependency-graph","owner":"PSeitz","description":"prints a dependency graph in dot/mermaid format for your typescript/react project","archived":false,"fork":false,"pushed_at":"2024-05-03T08:05:59.000Z","size":437,"stargazers_count":195,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T17:07:41.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PSeitz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-01T06:18:25.000Z","updated_at":"2025-03-13T09:09:06.000Z","dependencies_parsed_at":"2024-05-03T09:38:41.873Z","dependency_job_id":null,"html_url":"https://github.com/PSeitz/ts-dependency-graph","commit_stats":{"total_commits":78,"total_committers":4,"mean_commits":19.5,"dds":"0.11538461538461542","last_synced_commit":"41b517ffd55a73c3b491752459d9f01497436aa4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Fts-dependency-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Fts-dependency-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Fts-dependency-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSeitz%2Fts-dependency-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSeitz","download_url":"https://codeload.github.com/PSeitz/ts-dependency-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T08:30:32.454Z","updated_at":"2025-04-04T18:04:43.474Z","avatar_url":"https://github.com/PSeitz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Downloads](https://img.shields.io/npm/dm/ts_dependency_graph.svg?style=flat)](https://npmjs.org/package/ts_dependency_graph)\n![Node.js CI](https://github.com/PSeitz/ts-dependency-graph/workflows/Node.js%20CI/badge.svg)\n\n# TS-Dependency-Graph\n\nPrints a dependency graph in dot format for your typescript or react project. Supported files are .ts and .tsx.\nSupports tsconfig path mappings since v1.4.3.\n\n### Usage\n\n#### Install CLI\n\n`npm i ts_dependency_graph -g`\n\n```\n ts_dependency_graph --help\nOptions:\n  --help                          Show help                            [boolean]\n  --version                       Show version number                  [boolean]\n  --mermaid                       use mermaid markdown as output.      [boolean]\n  --color_edges                   use a random color to color the edges, group\n                                  by node.             [boolean] [default: true]\n  --start                         the starting file, for the analysis. can also\n                                  be a folder or a glob for multiple starting\n                                  files.                     [string] [required]\n  --graph_folder, --graphfolders  groups files in their folder in the graph\n                                                      [boolean] [default: false]\n  --aggregate_by_folder, --agg    create graph on folder level\n                                                      [boolean] [default: false]\n  --max_depth                                           [number] [default: 1000]\n  --filter                        removes files containing the provided\n                                  strings. Can be negated with - in front, to\n                                  remove files not containing the filter. e.g.\n                                  'NOT module1' - everything not containing\n                                  module1.ts will be filtered.\n                                                           [array] [default: []]\n  --filter_edges                  Experimental. removes edges containing the\n                                  provided strings, the format is\n                                  start_file=\u003etarget_file. The edges containing\n                                  start_file AND target_file are removed. Start\n                                  and target can be negated with 'NOT ' in front\n                                  . (Currently) This is not just a postprocess\n                                  on the graph. The edges won't be followed.\n                                  Note: put in quotes.     [array] [default: []]\n  --verbose, -v                   prints information about ignored files\n                                                      [boolean] [default: false]\n  --verbose_filter                prints information about filtered files and\n                                  edges               [boolean] [default: false]\n  --hotspots, -h                  identify hotspots, by analyzing number of\n                                  incoming and outgoing edges\n                                                      [boolean] [default: false]\n  --base_path                     calculates path relatives to the base path\n    [string] [default: \"/home/pascal/LinuxData/Development/ts-dependency-graph\"]\n  --show_path_to                  will display the shortest paths between start\n                                  and show_path_to                      [string]\n\n```\n\n`ts_dependency_graph --start src/index.ts`\n\nUse output with https://stamm-wilbrandt.de/GraphvizFiddle/#, https://dreampuf.github.io/GraphvizOnline/, http://www.webgraphviz.com/, or by piping result to dot tool\n\n```\nts_dependency_graph --start src/index.ts --graph_folder | dot -T svg \u003e dependencygraph.svg\n```\n\n![graph_example](https://raw.githubusercontent.com/PSeitz/ts-dependency-graph/master/self_example.svg)\n\n#### Real World Example\n\nUsage on [quickwit-ui](https://github.com/quickwit-oss/quickwit/tree/93097687060b89c2fa5e1668f158036574355938/quickwit-ui)\n\n```\nts_dependency_graph --start src/index.tsx --graph_folder | dot -T svg \u003e dependencygraph.svg\n```\n\n![Self Graph](./dependencygraph.svg)\n\n#### Use from Github Repo\n\n`npx ts-node src/index.ts --help`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseitz%2Fts-dependency-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpseitz%2Fts-dependency-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpseitz%2Fts-dependency-graph/lists"}