createUnstorageStorage
function createUnstorageStorage(options): UnstorageKvStorage;Defined in: src/storage/unstorage.ts:96
Create a KvStorage backed by an unstorage Storage instance. unstorage serializes JSON
values, so values round-trip structurally; missing keys read back as null.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
UnstorageStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createUnstorageStorage } from "@xtandard/kit/storage/unstorage";import { createStorage } from "unstorage";import fsDriver from "unstorage/drivers/fs";
const storage = createUnstorageStorage({ storage: createStorage({ driver: fsDriver({ base: "./data" }) }),});