该CLI将为TypeScript文件创建并生成所有的函数调用关系图。
全局安装
npm install -g typescript-call-graph
在任何的文件目录,运行:
tcg
它将提醒你如何使用CLI: 您需要指定特定的文件或全局的(通配符路径):
tcg myFile.ts folder/* anotherFolder/**/*
克隆仓库. 编辑 index.ts
或者 extract.ts
然后执行 npm start
构建以生成更改, 执行 npm test
来对仓库中的文件运行CLI.
非常欢迎有关如何改进此CLI的建议或PR。
您还可以根据需要编辑此存储库,并使用npm run global
安装自定义版本的tcg
命令。
- Matteo Abrate for the tangled tree visualization
- Mike Bostock for the arc diagram
- GraphViz, node-graphviz, and d3-graphviz for the simple graph
- Mermaid-JS for a way to create a graph
- Tutorial and code for processing TypeScript (AST)
- Tutorial for creating a CLI
- TS-Call-Graph for inspiration