Skip to main content

Built and signed on GitHub Actions

A WORM (Write-Once, Read-Many) map implementation designed for reliable storage of immutable values

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (1.0.0)

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

Examples

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);
Built and signed on
GitHub Actions
View transparency log

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";