https://github.com/joaompneves/tsviz
Typescript UML Visualizer
https://github.com/joaompneves/tsviz
Last synced: 11 months ago
JSON representation
Typescript UML Visualizer
- Host: GitHub
- URL: https://github.com/joaompneves/tsviz
- Owner: joaompneves
- License: isc
- Created: 2015-10-18T16:06:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-08T22:58:09.000Z (over 3 years ago)
- Last Synced: 2025-03-30T03:09:22.974Z (12 months ago)
- Language: TypeScript
- Size: 566 KB
- Stars: 197
- Watchers: 8
- Forks: 39
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - tsviz
README
# tsviz
[](https://www.npmjs.com/package/tsviz)
[](https://www.npmjs.com/package/tsviz-cli)
This simple tool creates a UML diagram from typescript modules.

## Installation
```bash
npm install -g tsviz-cli
```
You also need to install [GraphViz](http://www.graphviz.org/download/), including correctly added it to your PATH.
## Usage
### Cli
```
tsviz-cli
Available switches:
-d, dependencies: produces the modules dependencies diagram
-svg: output an svg file
```
In order to create a diagram for an entire project you simply type:
```bash
tsviz-cli samples/ diagram.png
```
### Library
You may also consume tsviz npm library in your project to obtain a digest of modules, classes, methods, etc, of a given typescript project.
```bash
npm install tsviz
```
```typescript
import { getModules, getModulesDependencies } from "tsviz";
const tsConfigDir = "path/where/your/tsconfig/lives";
const modules = getModules(tsConfigDir);
...
const modulesDependencies = getModulesDependencies(tsConfigDir);
...
```