Outputs
Outputs
outputs tells Nest Graph Inspector where to publish the generated dependency graph. Use one output for a focused workflow, or combine several outputs when your team needs an interactive viewer, committed documentation, and machine-readable data at the same time.
Web Viewer
Usage
{ type: 'viewer' }
Description
The Viewer output is the fastest way to understand a NestJS application visually. It installs a graph endpoint inside your app and connects it to the hosted interactive viewer, so you can explore modules, providers, controllers, imports, exports, and dependencies without opening generated files by hand.
API
| API | Description | Benefit |
|---|---|---|
type: 'viewer' | Enables the interactive web viewer output. | Gives developers a visual graph they can open from the console message after the app starts. |
origin?: string | The public or local origin of your running NestJS app, for example http://localhost:3000. | Prints a direct viewer link that already knows where to load graph data from. This is ideal for shared local setup, demos, and environment-based configuration. |
path?: string | The route path used to serve the graph endpoint. Defaults to /__graph-inspector. | Lets you avoid route conflicts and match your app's internal route naming. |
Markdown
Usage
{ type: 'markdown', path: 'graph.md' }
Description
The Markdown output turns your dependency graph into durable project documentation. It writes a .md file with a Mermaid diagram and module-by-module details, making it a strong fit for repository docs, pull request reviews, architecture notes, and onboarding material.
API
| API | Description | Benefit |
|---|---|---|
type: 'markdown' | Enables Markdown file generation. | Produces readable documentation that can live beside your source code. |
path: string | File path for the generated Markdown file, resolved from the current working directory. | Keeps the graph easy to find, commit, review, or publish with your existing docs workflow. |
JSON
Usage
{ type: 'json', path: 'graph.json' }
Description
The JSON output gives you the raw module map in a structured format. Use it when you want to build custom checks, compare graph snapshots, feed another visualization tool, or automate architecture reporting in CI.
API
| API | Description | Benefit |
|---|---|---|
type: 'json' | Enables JSON file generation. | Creates a stable data artifact for tools, scripts, and automated analysis. |
path: string | File path for the generated JSON file, resolved from the current working directory. | Makes the output predictable and easy to consume from CI jobs, local scripts, or custom dashboards. |
HTTP Endpoint
Usage
{ type: 'http' }
Description
The HTTP output serves the graph directly from your running NestJS application. It is useful when another service, dashboard, test runner, or browser-based tool needs live graph data without reading from the filesystem.
With the default path, the graph is available at:
/__nest-graph-inspectorfor the JSON graph endpoint used by the viewer/__nest-graph-inspector/output.jsonfor the raw JSON graph output/__nest-graph-inspector/output.mdfor the markdown graph output
API
| API | Description | Benefit |
|---|---|---|
type: 'http' | Enables JSON and markdown graph endpoints in your NestJS app. | Makes the current dependency graph available over HTTP as soon as the app is running. |
path?: string | Route path used to serve the graph. Defaults to /__nest-graph-inspector. | Lets you expose graph data at a route that fits your app conventions, such as /internal/graph or /debug/dependencies. |
