Skip to content

Graph Grammar

Author rewrite rules, match subgraphs, and transform graphs , a fast, framework-agnostic engine for TypeScript.

Framework-agnostic

The engine has no DOM or framework dependencies , just zod. Use it in Node, the browser, or a worker.

Fast

O(1) label buckets, an allocation-free VF2-style matcher, and single-match rewriting keep parallel-growth grammars O(N) , ~116,000 steps/s to 50k nodes.

Expressive rules

Property predicates, negative application conditions, edge embedding, property expressions, and four application strategies.

Validated I/O

Import and export grammars as JSON with runtime zod validation built in.

Terminal window
npm install graph-grammar

graph-grammar is built and maintained by Kiberon Labs.

Built by Kiberon Labs