StorageArea
import { StorageArea } from "https://raw.githubusercontent.com/worker-tools/cloudflare-kv-storage/master/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.
class StorageArea implements StorageArea {}