import * as kvToolbox from "https://deno.land/x/kv_toolbox@0.10.0/blob.ts";
A set of APIs for storing arbitrarily sized blobs in Deno KV. Currently Deno
KV has a limit of key values being 64k. The set
function breaks
down a blob into chunks and manages sub-keys to store the complete value. The
get
function reverses that process, and remove
function will delete the key, sub-keys and values.
Example
import { get, remove, set } from "jsr:@kitsonk/kv-toolbox/blob";
const kv = await Deno.openKv();
const data = new TextEncoder().encode("hello deno!");
await set(kv, ["hello"], data);
const ab = await get(kv, ["hello"]);
// do something with ab
await remove(kv, ["hello"]);
await kv.close();
Functions
f get | Retrieve a binary object from the store with a given key that has been
|
Remove/delete a binary object from the store with a given key that has been
| |
f set | Set the blob value in the provided |