Installation
Install @statelyai/graph using your preferred package manager.Package Managers
Optional Peer Dependencies
Some format converters require additional peer dependencies. Install them only if you need the corresponding format:XML Formats (GEXF, GraphML)
For GEXF and GraphML support:DOT Format (Graphviz)
For DOT format support:Validation (Zod)
For runtime schema validation:All peer dependencies are optional. The core library works without any of them. Only install what you need for your specific use case.
Import Paths
The library uses subpath exports for tree-shaking. Import only what you need:Core Functions
Format Converters
Each format has its own import path:TypeScript Configuration
The library is written in TypeScript and includes type definitions. No additional setup is required for TypeScript projects.The library requires ES modules. If you’re using CommonJS, you may need to configure your build tool to handle ES module imports.
Version Support
- Node.js: 18.x or higher recommended
- TypeScript: 5.0 or higher
- Package Manager: npm 7+, yarn 1.22+, or pnpm 8+
Next Steps
Quick Start
Create your first graph
Core Concepts
Learn about graph structure and types