Skip to content

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.

Parameter Type
options UnstorageStorageOptions

UnstorageKvStorage

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" }) }),
});