Storage Utils
@theholocron/storage-utils provides a namespaced session storage abstraction. Apps register under a name and read/write isolated storage slices without key collisions.
Install
pnpm add @theholocron/storage-utilsAPI
storage.session
A pre-built namespaced session storage instance (under the @theholocron namespace).
import { storage } from "@theholocron/storage-utils";
// Register your app firststorage.session.registerApp("my-app");
// Write a value (dot-separated key supports nesting)storage.session.sendTo("user.name", "Alice");
// Read a namespaceconst data = storage.session.getFrom("my-app");
// Read everythingconst all = storage.session.getAll();
// Remove a namespacestorage.session.removeFrom("my-app");
// Clear all storagestorage.session.clear();TSessionStorage interface
interface TSessionStorage { registerApp: (appName: string) => void; sendTo: (key: string, value: unknown) => void; getAll: () => object; getFrom: (key: string) => object | null; removeFrom: (key: string) => void; clear: () => void;}Notes
This package uses the browser sessionStorage API. It degrades gracefully in environments where sessionStorage is unavailable.