migrateFileStorage
function migrateFileStorage(options): Promise<{ moved: number;}>;Defined in: src/storage/file.ts:352
One-time upgrade of a store in the legacy layout (raw key segments as file names, so keys differing only by case shared a file on case-insensitive filesystems). Moves every leaf that is not in the encoded layout to its encodeSegment path and removes the emptied directories. Idempotent; run it with no writer on the store. Resolves how many keys moved.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Pick<FileStorageOptions, "dir"> |
Returns
Section titled “Returns”Promise<{
moved: number;
}>
Example
Section titled “Example”import { migrateFileStorage } from "@xtandard/kit/storage/file";
await migrateFileStorage({ dir: "./data" });