@s2-dev/streamstore - v0.18.1
    Preparing search index...

    Class S2Stream

    Index

    Constructors

    Properties

    name: string

    Methods

    • Append one or more records to the stream.

      • Automatically base64-encodes when format is "bytes".
      • Supports conditional appends via fencing_token and match_seq_num.
      • Returns the acknowledged range and the stream tail after the append.

      All records in a single append call must use the same format (either all string or all bytes). For high-throughput sequential appends, use appendSession() instead.

      Parameters

      Returns Promise<AppendAck>

    • Read records from the stream.

      • When as: "bytes" is provided, bodies and headers are decoded from base64 to Uint8Array.
      • Supports starting position by seq_num, timestamp, or tail_offset and can clamp to the tail.
      • Non-streaming reads are bounded by count and bytes (defaults 1000 and 1 MiB).
      • Use readSession for streaming reads

      Type Parameters

      • Format extends "string" | "bytes" = "string"

      Parameters

      Returns Promise<ReadBatch<Format>>