@botmesh/core - v2.0.0-alpha.2
    Preparing search index...

    Interface FileDurabilityOptions

    Options of FileDurability.open.

    interface FileDurabilityOptions {
        lock?: boolean;
        lockWaitMs?: number;
        appendLog?:
            | boolean
            | { compactEvery?: number; compactBytes?: number; fsync?: boolean };
        fsync?: boolean;
    }
    Index
    lock?: boolean

    Skip the advisory lock file (only when something else guarantees a single writer).

    lockWaitMs?: number

    How long open() waits for a lock file that another opener has created but not written its pid to yet (default 2000 ms). An empty lock older than 10 s is treated as stale.

    appendLog?:
        | boolean
        | { compactEvery?: number; compactBytes?: number; fsync?: boolean }

    Append-only journal (<file>.log): each write appends one line instead of rewriting the whole snapshot, and the snapshot is rewritten (and the log truncated) every compactEvery entries (1000) or compactBytes (4 MiB). true uses those defaults; false/omitted keeps the whole-snapshot behaviour. A leftover log is always replayed (and folded into a snapshot) on open, even with this off.

    fsync?: boolean

    fsync every snapshot before it replaces the previous one (and the directory after the rename, where the platform allows it), so a power loss cannot leave an empty or partial journal. Also the default of appendLog.fsync. Default false: the write is atomic (temp file + rename) but may still sit in the OS cache when the machine loses power.