Skip to content
UniKVS
Esc
↑↓navigate↵open⌘Jpreview
On this page

UniKVS

Documentation for UniKVS, a modular KVS client for TypeScript. Choose tutorials, how-to guides, explanations, or references depending on your goal.

UniKVS is a modular, portable KVS client for TypeScript. It combines middleware that transparently transforms data with storages that write to multiple backends, assembled through a builder.

How to Read

These docs follow the four Diátaxis categories. Pick the entry point that matches your current goal.

Quickstart

Start with the minimal in-memory setup. It takes about 5 minutes.

import { Memory } from "@unikvs/memory";
import * as unikvs from "unikvs";

const kvs = new unikvs.Builder<{
  greeting: unikvs.PlainValue<string>;
}>()
  .persist(new Memory())
  .build();

await kvs.open();
await kvs.set("greeting", "hello");

const value = await kvs.get("greeting");
console.log(value); // "hello"

await kvs.close();

See Your First UniKVS for the full walkthrough.

Key Features

  • Transparent encoding and decoding via middleware.
  • Parallel writes to multiple storages.
  • Per-key value types that restrict available operations at the type level.
  • Runtime validation of input/output values with Valibot schemas.
  • Support for both single values and streams.
  • Cancellation via AbortSignal and per-operation runtime variables.
  • Storages for both Node.js and browsers.

Packages

Each package is documented in the package reference. Representative packages:

Was this page helpful?