{"id":41167,"library":"grafio","title":"Grafio","description":"Grafio (v7.15.1) is a high-performance, in-memory graph database for Node.js with native Cypher query support and pluggable storage backends (in-memory built-in, MongoDB via separate package). It supports BFS/DFS traversal, atomic transactions with automatic rollback, DAG validation, topological sort, and Mermaid graph export. Key differentiators: Cypher-native query engine compatible with OpenCypher, smart LRU/LFU/FIFO caching with budget enforcement, and TypeScript-first design. Release cadence: irregular, with active development.","status":"active","version":"7.15.1","language":"javascript","source_language":"en","source_url":"https://github.com/satya-jugran/grafio","tags":["javascript","graph","database","cypher","in-memory","typescript","transactions","traversal","graph-database"],"install":[{"cmd":"npm install grafio","lang":"bash","label":"npm"},{"cmd":"yarn add grafio","lang":"bash","label":"yarn"},{"cmd":"pnpm add grafio","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Redis storage backend (optional, not required for in-memory)","package":"ioredis","optional":true}],"imports":[{"note":"ESM-only package; CommonJS require works but incorrect destructuring pattern often causes errors","wrong":"const CypherEngine = require('grafio').CypherEngine;","symbol":"CypherEngine","correct":"import { CypherEngine } from 'grafio'"},{"note":"InMemoryGraphFactory is exported from a subpath 'grafio/storage', not the main entry","wrong":"import { InMemoryGraphFactory } from 'grafio'","symbol":"InMemoryGraphFactory","correct":"import { InMemoryGraphFactory } from 'grafio/storage'"},{"note":"Graph is a TypeScript interface; use type import for type-only uses, but value import works if using runtime features (rare)","wrong":"import { Graph } from 'grafio'","symbol":"Graph","correct":"import type { Graph } from 'grafio'"}],"quickstart":{"code":"import { CypherEngine } from 'grafio';\nimport { InMemoryGraphFactory } from 'grafio/storage';\n\nconst factory = new InMemoryGraphFactory();\nconst graph = factory.forGraph('social-network');\nconst cypher = new CypherEngine(graph);\n\ncypher.execute(`\n    CREATE (a:Person {id: 'alice', name: 'Alice', age: 30}),\n    CREATE (b:Person {id: 'bob', name: 'Bob', age: 25}),\n    CREATE (c:Person {id: 'charlie', name: 'Charlie', age: 35})\n`);\ncypher.execute(`\n  MATCH (a:Person {id: 'alice'}), (b:Person {id: 'bob'})\n  CREATE (a)-[:KNOWS {since: 2020}]->(b)\n`);\ncypher.execute(`\n  MATCH (b:Person {id: 'bob'}), (c:Person {id: 'charlie'})\n  CREATE (b)-[:KNOWS {since: 2019}]->(c)\n`);\n\nconst friends = cypher.execute('MATCH (p:Person)-[:KNOWS]->(friend:Person) RETURN p.name as name, friend.name as friend');\nconsole.log(JSON.stringify(friends, null, 2));","lang":"typescript","description":"Quick start showing in-memory graph creation, Cypher EXECUTE for CREATE and MATCH, and querying relationships."},"warnings":[{"fix":"Use 'import { InMemoryGraphFactory } from 'grafio/storage'' instead of from 'grafio'.","message":"Subpath imports: 'grafio/storage' must be imported separately for storage factories; main entry does not re-export them.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Update calls: factory.forGraph(id) instead of factory.createGraph(id).","message":"Breaking: In v7, the storage API was refactored; GraphFactory.createGraph(id) replaced by factory.forGraph(id).","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Use generic result type: Record<string, unknown>[] or assert with Zod.","message":"CypherEngine.execute() returns plain objects, not Records. Do not expect GraphResult or similar types.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Replace .query() calls with .execute().","message":"The 'query' method on CypherEngine is deprecated in favor of 'execute'. Using 'query' may be removed in future versions.","severity":"deprecated","affected_versions":">=7.10.0"}],"env_vars":null,"search_vec":"'activ':77 'atom':39 'automat':42 'backend':24 'bfs/dfs':37 'budget':66 'built':29 'built-in':28 'cach':64 'cadenc':74 'compat':59 'cypher':18,55,82 'cypher-n':54 'dag':44 'databas':13,81,91 'design':72 'develop':78 'differenti':53 'enforc':67 'engin':58 'export':51 'first':71 'grafio':1,2 'graph':12,50,80,90 'graph-databas':89 'high':7 'high-perform':6 'in-memori':9,25,83 'irregular':75 'javascript':79 'key':52 'lru/lfu/fifo':63 'memori':11,27,85 'mermaid':49 'mongodb':31 'nativ':17,56 'node.js':15 'opencyph':61 'packag':34 'perform':8 'pluggabl':22 'queri':19,57 'releas':73 'rollback':43 'separ':33 'smart':62 'sort':47 'storag':23 'support':20,36 'topolog':46 'transact':40,87 'travers':38,88 'typescript':70,86 'typescript-first':69 'v7.15.1':3 'valid':45 'via':32","created_at":"2026-06-04T18:51:06.194690+00:00","updated_at":"2026-06-04T18:51:06.194690+00:00","problems":[{"fix":"Ensure Node.js version >= 14 (or use bundler that supports exports field). For CommonJS, use 'grafio/storage' with require but ESM is recommended.","cause":"Subpath imports not resolved (common with bundlers or older Node versions).","error":"Error: Cannot find module 'grafio/storage'"},{"fix":"Use named import: import { CypherEngine } from 'grafio';","cause":"Importing CypherEngine incorrectly (e.g., default import vs named import).","error":"CypherEngine is not a constructor"},{"fix":"Use factory.forGraph(id) (v7+).","cause":"Using old API from v6 where factory.createGraph existed.","error":"TypeError: graph.forGraph is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/satya-jugran/grafio#readme","github":"https://github.com/satya-jugran/grafio","docs":null,"changelog":null,"pypi":null,"npm":"grafio","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}