@canvas-js/okra-memory
v0.4.6
Published
Temporary Okra database backed by an in-memory red/black tree
Downloads
2,495
Readme
@canvas-js/okra-memory
Install
npm i @canvas-js/okra-memory
Usage
import { Tree } from "@canvas-js/okra-memory"
const tree = new Tree()
// ...
API
import { Metadata, ReadOnlyTransaction, ReadWriteTransaction, Leaf } from "@canvas-js/okra"
export declare class Tree {
public static fromEntries(
init: Partial<Metadata>,
entries: AsyncIterable<[Uint8Array, Leaf]>,
): Promise<Tree>
public readonly metadata: Metadata
public constructor(init?: Partial<Metadata>)
public close(): Promise<void>
public clear(): void
public read<T>(callback: (txn: ReadOnlyTransaction) => Awaitable<T>): Promise<T>
public write<T>(callback: (txn: ReadWriteTransaction) => Awaitable<T>): Promise<T>
}