Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whyboris/TypeScript-Call-Graph
CLI to generate an interactive graph of functions and calls from your TypeScript files
https://github.com/whyboris/TypeScript-Call-Graph
callgraph cli typescript
Last synced: about 2 months ago
JSON representation
CLI to generate an interactive graph of functions and calls from your TypeScript files
- Host: GitHub
- URL: https://github.com/whyboris/TypeScript-Call-Graph
- Owner: whyboris
- License: mit
- Created: 2020-06-05T23:50:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-24T17:02:10.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T21:04:24.162Z (2 months ago)
- Topics: callgraph, cli, typescript
- Language: JavaScript
- Homepage:
- Size: 1.05 MB
- Stars: 237
- Watchers: 4
- Forks: 20
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm](https://img.shields.io/npm/v/typescript-call-graph)](https://www.npmjs.com/package/typescript-call-graph)
# TypeScript Call Graph
This **CLI** will create an interactive graph of all the functions and their calls in the TypeScript files you provide.
⚠️ This is a work in progress 🚧 More visualization contributions are welcome.
![image](https://user-images.githubusercontent.com/17264277/85908941-62ba6d00-b7e5-11ea-8e50-2686990aa4f5.png)
## How to use
Install globally:
```sh
npm install -g typescript-call-graph
```Inside any directory, run:
```sh
tcg
```It will remind you how to use the CLI: you need to provide specific files, or globs (wildcard paths):
```sh
tcg myFile.ts folder/* anotherFolder/**/*
```## Developing
Clone repository. Edit `index.ts` and/or `extract.ts` and run `npm start` to build changes, `npm test` to run CLI against files in this repository.
Suggestions or PRs for how to improve this CLI are very welcome 🙇
You may also edit this repository as you'd like and install your custom version of `tcg` command with `npm run global`
### Thank you
- [Matteo Abrate](https://observablehq.com/@nitaku/tangled-tree-visualization-ii) for the _tangled tree visualization_
- [Mike Bostock](https://observablehq.com/@d3/arc-diagram) for the _arc diagram_
- [GraphViz](https://graphviz.org/), [node-graphviz](https://github.com/glejeune/node-graphviz), and [d3-graphviz](https://github.com/magjac/d3-graphviz) for the simple graph
- [Mermaid-JS](https://github.com/mermaid-js/mermaid) for a way to create a graph
- [Tutorial](https://convincedcoder.com/2019/01/19/Processing-TypeScript-using-TypeScript/) and code for processing TypeScript (AST)
- [Tutorial](https://developer.okta.com/blog/2019/06/18/command-line-app-with-nodejs) for creating a *CLI*
- [TS-Call-Graph](https://github.com/Deskbot/TS-Call-Graph) for inspiration