A WORM (Write-Once, Read-Many) map implementation designed for reliable storage of immutable values
This module provides a Registry
class, which allows for registering a unique key-value pair once
Once registered, the data cannot be modified or overwritten
Example 1
import { type Holder, Registry } from "@forest/registry"; import { assertEquals, assertExists } from "@std/assert"; const registry: Registry<string, number> = new Registry(); registry.register("meaning of life", 42); const holder: Holder<string, number> | null = registry.get("meaning of life"); assertExists(holder); assertEquals(holder.value, 42);
Add Package
deno add jsr:@forest/registry
Import symbol
import * as registry from "@forest/registry";
---- OR ----
Import directly with a jsr specifier
import * as registry from "jsr:@forest/registry";
Add Package
npx jsr add @forest/registry
Import symbol
import * as registry from "@forest/registry";
Add Package
yarn dlx jsr add @forest/registry
Import symbol
import * as registry from "@forest/registry";
Add Package
pnpm dlx jsr add @forest/registry
Import symbol
import * as registry from "@forest/registry";
Add Package
bunx jsr add @forest/registry
Import symbol
import * as registry from "@forest/registry";