graph
Graph dependencies within workspace
Usage
nx graphInstall nx globally to invoke the command directly using nx, or use npx nx, yarn nx, or pnpx nx.
Examples
Open the project graph of the workspace in the browser:
nx graphSave the project graph into a json file:
nx graph --file=output.jsonGenerate a static website with project graph into an html file, accompanied by an asset folder called static:
nx graph --file=output.htmlShow the graph where every node is either an ancestor or a descendant of todos-feature-main:
nx graph --focus=todos-feature-mainInclude project-one and project-two in the project graph:
nx graph --include=project-one,project-twoExclude project-one and project-two from the project graph:
nx graph --exclude=project-one,project-twoShow the graph where every node is either an ancestor or a descendant of todos-feature-main, but exclude project-one and project-two:
nx graph --focus=todos-feature-main --exclude=project-one,project-twoWatch for changes to project graph and update in-browser:
nx graph --watchOptions
exclude
Type: array
List of projects delimited by commas to exclude from the project graph.
file
Type: string
Output file (e.g. --file=output.json or --file=dep-graph.html)
focus
Type: string
Use to show the project graph for a particular project and every node that is either an ancestor or a descendant.
groupByFolder
Type: boolean
Group projects by folder in the project graph
help
Type: boolean
Show help
host
Type: string
Bind the project graph server to a specific ip address.
open
Type: boolean
Default: true
Open the project graph in the browser.
port
Type: number
Bind the project graph server to a specific port.
version
Type: boolean
Show version number
watch
Type: boolean
Default: false
Watch for changes to project graph and update in-browser