Skip to content

createFileStorage

function createFileStorage(options): FileKvStorage;

Defined in: src/storage/file.ts:227

Create a file-backed FileKvStorage. Values are pretty-printed JSON. watch uses a recursive fs.watch on the base directory; it is best-effort and may coalesce or miss events on platforms without recursive-watch support. A rename event is reported as remove only when the file is actually gone.

Parameter Type
options FileStorageOptions

FileKvStorage

import { createFileStorage } from "@xtandard/kit/storage/file";
const storage = createFileStorage({ dir: "./data" });