@scottstts/typegraph
v0.1.0
Published
Explore TypeScript type relationships from the command line in an interactive dependency graph.
Maintainers
Readme
TypeGraph
Explore the TypeScript type structure of a local project or public GitHub repository as an interactive dependency graph.
Run without installing
npx @scottstts/typegraph show .Install globally
npm install --global @scottstts/typegraph
typegraph show .
typegraph export . --out typegraph.jsonThe shorter tg binary is also available after installation.
Analyze a public GitHub repository
typegraph show https://github.com/owner/repo
typegraph export https://github.com/owner/repo --out typegraph.jsonRepository root, branch, subdirectory, and blob URLs are supported. GitHub targets must be explicit github.com URLs.
Commands
typegraph
typegraph --help
typegraph show [path | github-url] [--project tsconfig.json]
typegraph index [path | github-url] [--project tsconfig.json]
typegraph export [path | github-url] [--out typegraph.json] [--project tsconfig.json]- With no arguments, TypeGraph prints the available commands and options.
--helpand-hprint the same help output.showindexes the target and starts the local web explorer.indexprints a graph summary.exportwrites the complete graph as JSON. The default output istypegraph.json.--projectselects a TypeScript config for local filesystem targets only.
Supplying a path or GitHub URL without a command still defaults to show.
Requirements
- Node.js 20 or newer
- A TypeScript project with a discoverable
tsconfig.json, unless analyzing a GitHub repository
Local development
npm install
npm test
npm run lint
npm run typecheck
npm run build
npm run dev:mockThe npm package build contains the CLI, local server, graph engine, and local explorer. The separate hosted browser app is at: TypeGraph
