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.
default
✓ const gremlinOrm = require('gremlin-orm');
✗ import gremlinOrm from 'gremlin-orm';
Package does not support ESM imports; use CommonJS require. Only default export available.
def
✓ const Person = g.define('person', { ... });
Define model via instance method after constructing gremlinOrm instance.
queryRaw
✓ const result = await g.queryRaw('g.V().limit(10)');
Use async/await or callbacks; queryRaw returns raw Gremlin response.
Connects to Neo4j Gremlin server, defines a Person model, creates a vertex, then retrieves all vertices.
const gremlinOrm = require('gremlin-orm');
const g = new gremlinOrm('neo4j', process.env.GPORT ?? '8182', process.env.GHOST ?? 'localhost', { ssl: false });
const Person = g.define('person', {
name: { type: g.STRING, required: true },
age: { type: g.NUMBER }
});
Person.create({ name: 'Alice', age: 30 }, (err, result) => {
if (err) console.error(err);
else console.log('Created:', result);
});
Person.findAll({}, (err, results) => {
if (err) console.error(err);
else console.log('All persons:', results);
});
Debug
Known issues
deprecatedPackage last updated in November 2022; no activity since. May lack security patches and modern Gremlin server compatibility.fixConsider alternative libraries like gremlin-javascript directly, or evaluate usage with current database versions.
affects: >=1.0.0
gotchaESM imports not supported; using `import` from this package will fail. Must use CommonJS `require`.fixUse `const gremlinOrm = require('gremlin-orm');` in a CommonJS context. affects: all
gotchaThe `dialect` argument for Azure Cosmos DB requires an array with partition name, e.g., `['azure', 'partitionName']`. Omitting will cause connection errors.fixPass correct dialect: `new gremlinOrm(['azure', 'myPartition'], ...)`.
affects: all
breakingServer compatibility: Requires Gremlin Server supporting `gremlin-groovy` script engine. Some high-end server versions dropped scripting; this ORM will not work.fixUse gremlin-javascript client directly with bytecode queries or use legacy Gremlin Server.
affects: >=3.5.0 (server)
Errors
Common errors & fixes
Cannot find module 'gremlin-orm'
Package not installed or name misspelled (note hyphen vs underscore).
fixRun `npm install gremlin-orm` and use `require('gremlin-orm')` (not 'gremlin_orm'). TypeError: gremlinOrm is not a constructor
Trying to use ES6 `import` on a CommonJS-only module without default interop.
fixUse `const gremlinOrm = require('gremlin-orm');` and then `new gremlinOrm(...)`. Read ECONNRESET
TLS/connection issue: SSL enabled but certificate rejected, or wrong host/port.
fixEnsure Gremlin Server is running. For local dev without SSL, set `{ ssl: false }`. For Azure, configure proper endpoint and credentials. Audit
Dependencies
No dependency data recorded yet.