@riaskov/nestjs-graph-visualizer
v1.0.1
Published
Generate a visualization of your NestJS app's dependency graph (Nest.js services, modules etc.)
Readme
nestjs-graph-visualizer 🔍✨
Generate a visualization of your NestJS app's dependency graph! 💥
🚀 Why nestjs-graph-visualizer?
- Instant Architecture Overview: See how your modules and providers connect at a glance.
- Zero Side Effects: No bootstrapping of NestFactory or unwanted runtime behaviors.
- Minimal & Sexy: A single CLI, one command, pure simplicity.
📦 Installation
Install globally:
npm install -g @riaskov/nestjs-graph-visualizerOr as a dev dependency:
npm install --save-dev @riaskov/nestjs-graph-visualizer⚡️ Quick Start
Generate a Mermaid diagram:
nestjs-graph-visualizer --entry src/app.module.tsGenerate a DOT file:
nestjs-graph-visualizer --entry dist/app.module.js --format dot✨ Features
- 📝 TS & JS Support: Point to
.tsor.js—CLI handles it for you. - 📊 Mermaid & DOT: Embed directly in Markdown or render to SVG.
- 🔍 Static Analysis: No DI container, no NestFactory—just metadata parsing.
🛠️ CLI Options
| Option | Description | Default |
| ------------------- | --------------------------------------------------- | ---------------------- |
| --entry, -e | Path to your root module file (.ts or .js) | required |
| --format, -f | Output format: mermaid or dot | mermaid |
| --output, -o | Destination file path | dependency-graph.md |
| --help, -h | Show help | — |
🖼️ Mermaid Example
```mermaid
graph TD
AppModule["AppModule"]
ConfigModule["ConfigModule"]
AppModule --> ConfigModule
# ... more nodes and edges
---
## 🧑💻 Development & Build
```bash
# Clone the repo
git clone https://github.com/ARyaskov/nestjs-graph-visualizer.git
cd nestjs-graph-visualizer
# Install deps
npm i
# Build to JS
npm run build
# Do npm link if you want to have a global version of a command
npm link🤝 Contributing
- Fork this repo 🍴
- Create a feature branch (
feat/awesome-graph) - Commit your changes and open a Pull Request 🚀
📄 License
Released under the MIT License ❤️
Crafted with love for clean code and sexy diagrams! 😎
