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

Installation

How to install UniKVS and plugins for your runtime.

Install only the packages you need for your target backends and transformations.

Install the Core

unikvs is required. Backends and transformations are separate packages.

npm install unikvs
pnpm add unikvs
yarn add unikvs
bun add unikvs
nub add unikvs
aube add unikvs

Add Storages

Add the packages for the backends you use. Common combinations:

For tests and temporary storage. No external services needed.

npm install @unikvs/memory
pnpm add @unikvs/memory
yarn add @unikvs/memory
bun add @unikvs/memory
nub add @unikvs/memory
aube add @unikvs/memory

Stores data on the local filesystem in Node.js.

npm install @unikvs/fs.node
pnpm add @unikvs/fs.node
yarn add @unikvs/fs.node
bun add @unikvs/fs.node
nub add @unikvs/fs.node
aube add @unikvs/fs.node

In browsers, choose from OPFS, IndexedDB, Local Storage, and others.

npm install @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage
pnpm add @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage
yarn add @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage
bun add @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage
nub add @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage
aube add @unikvs/opfs @unikvs/indexeddb @unikvs/localstorage

For choosing a backend, see Storage Comparison. For details on each package, see the package reference.

Add Transformations

Add middleware only when you need value transformation.

npm install @unikvs/json @unikvs/compression
pnpm add @unikvs/json @unikvs/compression
yarn add @unikvs/json @unikvs/compression
bun add @unikvs/json @unikvs/compression
nub add @unikvs/json @unikvs/compression
aube add @unikvs/json @unikvs/compression

For Validation

To validate input/output values with Valibot schemas, install valibot separately.

npm install valibot
pnpm add valibot
yarn add valibot
bun add valibot
nub add valibot
aube add valibot

Pass schemas to the Builder schema option to enable validation. See Validating Values for the steps.

Version Notes

  • Keep the core and plugin versions on the same release line where possible.
  • If you see peer dependency warnings, install what the warning requests. For example, if a logging-related peer dependency is requested, follow the instructions to install it.

Was this page helpful?