Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Deno
This package works with Deno
JSR Score100%
Publisheda month ago (0.9.0)

Deno KV+Filesystem Storage Module

Deno KV+Filesystem Storage Module

See @storage/main for the bigger picture.

This package provides an implementation of the storage module interface.

Combination of a readonly deno-fs and writeable deno-kv, allowing fallback or immutable storage in the filesystem, and mutable storage via the KV store.

By default the filesystem takes priority, and cannot be overridden by KV values, unless the env var STORE_PRIMARY is set to kv, in which case the KV always overrides filesystem values.

Import mapping: "$store": "jsr:@storage/deno-kv-fs"

Example

import * as store from "jsr:@storage/deno-kv-fs";
import { assertEquals } from "jsr:@std/assert";

await store.setItem(["foo", "hello"], "world");

assertEquals(await store.hasItem(["foo", "hello"]), true);
assertEquals(await store.getItem(["foo", "hello"]), "world");

await store.clearItems(["foo"]);
assertEquals(await store.hasItem(["foo", "hello"]), false);
Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@storage/deno-kv-fs

Import symbol

import * as deno_kv_fs from "@storage/deno-kv-fs";
or

Import directly with a jsr specifier

import * as deno_kv_fs from "jsr:@storage/deno-kv-fs";