Odb.open Async

Odb.open(objects_dir).then(function(odb) {
  // Use odb
});
Parameters Type  
objects_dir String path of the backends’ “objects” directory.
Returns  
Odb  

Odb#addDiskAlternate Sync

var result = odb.addDiskAlternate(path);
Parameters Type  
path String path to the objects folder for the alternate
Returns  
Number 0 on success; error code otherwise

Odb#expandIds Sync

var result = odb.expandIds(ids, count);
Parameters Type  
ids OdbExpandId An array of short object IDs to search for
count Number The length of the ids array
Returns  
Number 0 on success or an error code on failure

Odb#free Sync

odb.free();

Odb#read Async

odb.read(id).then(function(odbObject) {
  // Use odbObject
});
Parameters Type  
id Oid identity of the object to read.
Returns  
OdbObject the read object

Odb#write Async

odb.write(data, len, type).then(function(oid) {
  // Use oid
});
Parameters Type  
data Buffer buffer with the data to store
len Number size of the buffer
type Number type of the data to store
Returns  
Oid  

Odb.STREAM ENUM

Flag Value
Odb.STREAM.RDONLY 2
Odb.STREAM.WRONLY 4
Odb.STREAM.RW 6