footprintjs - v11.2.0
    Preparing search index...

    Function fileSink

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

      Every method returns at once: the line is encoded, checked against every bound, given its offset and handed to the I/O pool. The method's promise settles when that line is written; a write that fails rejects it, and the run counts the loss.

      Parameters

      Returns FileSink

      TypeError when path is not a non-empty string or does not name a regular file the writer owns alone; RangeError for a bound that is not a whole number ≥ 1; the operating system's error when the file cannot be opened (a symbolic link at path included). Made once, at setup — never during a run.

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

      const sink = fileSink('/var/footprint/orders.jsonl');
      const executor = new FlowChartExecutor(chart, { sink });
      await executor.run({ input });
      // …later, or after a crash:
      const record = readStoredRecord(readRecordFile('/var/footprint/orders.jsonl').entries);
      record.root(runId)?.complete; // false for a run that never ended