Registry / database / cypherdotjs

cypherdotjs

JSON →
library1.0.10jsnpmunverified

Cypher.js is a lightweight, in-memory graph database and partial implementation of the Cypher query language, written in JavaScript for Node.js (v1.0.10). It allows executing Cypher queries via a CLI tool (processing .cql files or interactive shell) or programmatically as a library. Key differentiators: pure JavaScript, no external dependencies, simple callback-based API. However, it is not a full Cypher implementation and lacks transaction support, indexing, and production-grade persistence. Suitable for prototyping or small-scale projects where a full Neo4j instance is overkill.

npm install cypherdotjs
INSTALL
IMPORT
SIG · CYPHERDOTJS
C
cypherdotjs
databasejavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Cypher
const Cypher = require('cypherdotjs');
import Cypher from 'cypherdotjs';
This package provides a CommonJS module; ESM import is not supported.
Cypher.execute
const cypher = new Cypher(); cypher.execute(query, onSuccess, onError);
Cypher.execute(query, callback);
execute is an instance method, not a static method. Must create an instance first.
require('cypherdotjs')
const cypherModule = require('cypherdotjs'); const cypher = new cypherModule();
const cypher = require('cypherdotjs'); cypher.execute(...);
require returns the constructor, not an instance.

Create an instance of Cypher and execute a simple CREATE/RETURN query with callbacks.

const Cypher = require('cypherdotjs'); const cypher = new Cypher(); const query = "CREATE (n:Person {name: 'Alice'}) RETURN n"; cypher.execute(query, (results) => { console.log('Success:', JSON.stringify(results)); }, (error) => { console.error('Error:', error); });
Debug
Known issues
gotchaThe package does not support ES module imports; use CommonJS require.
fix
Use require('cypherdotjs') instead of import.
affects: ~1.0.0
gotchaexecute() requires a success and error callback; it does not return a promise.
fix
Wrap in a Promise if needed: new Promise((resolve, reject) => cypher.execute(query, resolve, reject)).
affects: ~1.0.0
gotchaOnly a subset of Cypher queries are implemented; complex queries (e.g., WITH, UNION, pattern matching with multiple hops) may fail silently or throw.
fix
Check the source or keep queries simple. Do not rely on full Cypher compatibility.
affects: ~1.0.0
gotchaThe database is in-memory only; data is lost when the process exits.
fix
Implement your own persistence layer (e.g., serialize to JSON on exit) if you need data durability.
affects: ~1.0.0
gotchaGlobal installation for CLI uses a binary named 'cypher', which may conflict with other tools (e.g., the official Cypher shell).
fix
Install locally and run via npx or use an alias to avoid conflicts.
affects: ~1.0.0
Errors
Common errors & fixes
TypeError: Cypher is not a constructor
Using ES module import syntax on a CommonJS module, or accidentally using the module itself instead of calling new.
fix
Use const Cypher = require('cypherdotjs'); const cypher = new Cypher();
TypeError: cypher.execute is not a function
Calling execute on the constructor instead of an instance.
fix
Create an instance first: const cypher = new Cypher();
Error: Query execution failed: ...
Unsupported Cypher syntax used.
fix
Simplify the query to basic CREATE, MERGE, MATCH, RETURN statements without complex patterns.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cypherdotjs — npm install cypherdotjs · libregistry