class CloudflareStorageArea
implements StorageArea
import { CloudflareStorageArea } from "https://deno.land/x/cloudflare_kv_storage@v0.9.0-pre.4/index.ts";
An implementation of the StorageArea
interface wrapping Cloudflare Worker's KV store.
The goal of this class is ease of use and compatibility with other Storage Area implementations, such as https://github.com/GoogleChromeLabs/kv-storage-polyfill.
While work on the specification itself has stopped, it's still a good interface for asynchronous data access that feels native to JavaScript.
Note that efficiency is not a goal. Specifically, if you have sizable ArrayBuffer
s,
it's much better to use Cloudflare's KV directly.
Methods
clear(opts?: KVListOptions)
delete(key: AllowedKey)
entries<T>(opts?: KVListOptions): AsyncGenerator<[Key, T]>
get<T>(key: AllowedKey, opts?: unknown): Promise<T>
keys(opts?: KVListOptions): AsyncGenerator<Key>
set<T>(): Promise<void>
values<T>(opts?: KVListOptions): AsyncGenerator<T>