footprintjs - v11.2.0
    Preparing search index...

    Module footprintjs/sinks

    Node only. The crash-safe record as a JSON-lines file.

    This door imports node:fs; it is the one door that does (test/architecture/layering.test.ts), so every other door stays loadable in a browser. The port itself — RecordSink, and the reference memorySink() — is foottrace's (foottrace/write); the reader is readStoredRecord (foottrace).

    import { flowChart, FlowChartExecutor } from 'footprintjs';
    import { fileSink, readRecordFile } from 'footprintjs/sinks';
    import { readStoredRecord } from 'foottrace';

    const executor = new FlowChartExecutor(chart, { sink: fileSink('/var/footprint/orders.jsonl') });
    await executor.run({ input });

    // After a crash — in another process:
    const record = readStoredRecord(readRecordFile('/var/footprint/orders.jsonl').entries);
    for (const log of record.logs.values()) if (!log.complete) console.log('never finished:', log.address);
    FileSink

    A record sink that appends to one file — RecordSink plus what the app needs to manage the file.

    FileSinkOptions

    fileSink's options — every resource the sink can spend, bounded.

    IndexedRecordFile

    One immutable-file selection capability. No path, descriptor, mutable index or discovered run catalog is served.

    IndexedRecordFileOptions

    Host authorization is fixed before any stored entry is read. It is never inferred from the index.

    IndexedRecordScope
    IndexedRecordUnknown
    RecordFile

    A record file read back: every parsed line, and every line that could not be.

    IndexedRecordFileReason
    IndexedRecordFileResult
    DEFAULT_FILE_SINK_FLUSH_TIMEOUT_MS

    The default bound on flush(): 10 s.

    DEFAULT_FILE_SINK_MAX_BYTES

    The default cap on a record file: 64 MiB.

    DEFAULT_FILE_SINK_MAX_ENTRY_BYTES

    The default cap on ONE entry's line: 8 MiB.

    DEFAULT_FILE_SINK_MAX_QUEUED_BYTES

    The default cap on bytes accepted but not yet written: 16 MiB.

    fileSink

    A record sink that appends each entry to path as one JSON line — the crash-safe record on a Node host.

    openIndexedRecordFile

    Explicit bounded whole-file preparation, followed by authorized positional scope reads from that immutable file.

    readRecordFile

    Read a record file back, line by line — the entries for readStoredRecord, and every line that could not be read, by number, never a failed read. A stored key named __proto__ stays data (JSON.parse makes it an own property). The file is untrusted: a file larger than maxBytes (default 256 MiB) is refused before it is read.