Node.js
Requirements
Installation
npm install chrondbQuick Start
const { ChronDB } = require('chrondb')
// Single path (preferred)
const db = new ChronDB('./mydb')
// Save a document
db.put('user:1', { name: 'Alice', age: 30 })
// Retrieve it
const doc = db.get('user:1')
console.log(doc) // { name: 'Alice', age: 30 }ES Modules
API Reference
new ChronDB(dbPath, options?)
new ChronDB(dbPath, options?)Parameter
Type
Description
Legacy: new ChronDB(dataPath, indexPath, options?)
new ChronDB(dataPath, indexPath, options?)Parameter
Type
Description
put(id, doc, branch?) -> Object
put(id, doc, branch?) -> ObjectParameter
Type
Description
get(id, branch?) -> Object
get(id, branch?) -> Objectdelete(id, branch?) -> void
delete(id, branch?) -> voidlistByPrefix(prefix, branch?) -> Object[]
listByPrefix(prefix, branch?) -> Object[]listByTable(table, branch?) -> Object[]
listByTable(table, branch?) -> Object[]history(id, branch?) -> Object[]
history(id, branch?) -> Object[]query(query, branch?) -> Object
query(query, branch?) -> Objectexecute(sql, branch?) -> Object
execute(sql, branch?) -> ObjectParameter
Type
Description
TypeScript
Error Handling
Examples
Full CRUD
Idle Timeout (long-running services)
SQL Queries
Query
History (Time Travel)
Last updated
Was this helpful?