c0
    Preparing search index...

    Class StreamWriter

    Appends ETB-committed blocks to an append-only log.

    const log = new StreamWriter(sink) log.record('create', nonce, ts) log.batch(b => { // atomic multi-record commit b.record('name', label, ts) b.record('tag', tag, ts) })

    Each block and its ETB are issued as a single write. When appending to an existing log, repair the tail first (see openLog) — blind appends after a torn tail are unsafe (a tail ending in a bare DLE would escape the next append's RS and fuse two records).

    Hierarchy (View Summary)

    Index
    • Append several records under a single commit. The batch is atomic: a tear anywhere inside it discards the whole block.

      Parameters

      Returns void

    • Append a group preamble (GS + name) as a committed block.

      Parameters

      • name: string
      • Optionalheaders: string[] | null

      Returns void

    • Append an SOH header as a committed block.

      Parameters

      • ...names: string[]

      Returns void

    • Append one record as a committed block.

      Parameters

      • ...fields: string[]

      Returns void

    • Append one record from an array of fields.

      Parameters

      • fields: string[]

      Returns void