Readme

Usage

import { openKv } from "https://esm.town/v/pomdtr/kv" const kv = openKv() await kv.set("test", true) console.log(await kv.get("test"))
1
2
3
4
5
6
7
8
import { callerRef } from "https://esm.town/v/pomdtr/refs";
import { sqliteStore } from "https://esm.town/v/vladimyr/keyvhqSqlite";
import Keyv from "npm:@keyvhq/core";
export function openKv<T = any>() {
const { slug } = callerRef();
return new Keyv<T>({ store: sqliteStore, namespace: slug });
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v3
March 31, 2024