MEMORY_CAPABILITIESconstconst MEMORY_CAPABILITIES: readonly ["read", "write", "list", "stat", "delete", "cas", "batch", "rename", "history"]The capabilities of the store in memory.
The store in memory: every capability a store can keep without help, held in a map, and the reference every other backend is compared with. Its revision is sha256: and the digest of the bytes, so the same bytes are the same revision wherever they are; a batch is applied to a copy of the state and committed whole, so it is all or nothing; a history keeps every revision an object has had until it is deleted.
import { memoryStore } from "./mod.ts";
const store = memoryStore({ name: "scratch" });
store.id; // "memory:scratch"MEMORY_CAPABILITIESconstconst MEMORY_CAPABILITIES: readonly ["read", "write", "list", "stat", "delete", "cas", "batch", "rename", "history"]The capabilities of the store in memory.
MemoryStoretypeno test imports ittype MemoryStore = Store<(typeof MEMORY_CAPABILITIES)[number]>;The type of the store in memory.
MemoryOptionstypeno test imports ittype MemoryOptions = { readonly name?: string; readonly clock?: () => number };What the store in memory is made with: its name and the clock that dates a change, in milliseconds.
revisionOfBytesfunctionno test imports itfunction revisionOfBytes(bytes: Uint8Array<ArrayBufferLike>): Promise<Revision>The revision of some bytes: sha256: and their digest.
memoryStorefunctionfunction memoryStore(options?: MemoryOptions): MemoryStoreA store in memory.