XStream

Transform binary stream.
Import

When To Use#

  • Transform SSE protocol ReadableStream to Record
  • Decode and read any protocol ReadableStream

Examples#

SSE - https://developer.mozilla.org/en-US/docs/Web/API/Server-sent\_events

The default transformStream in XStream is an SSE protocol stream transformer and is optional. The readableStream accepts a new ReadableStream(...) instance, such as await fetch(...).body

      Loading...
    

In this example, we will demonstrate parsing the SIP protocol, which is commonly used for P2P audio and video session initiation.

Pass in a transformStream stream transformer; this parameter accepts a new TransformStream(...) instance.

      Loading...
    

API#

XStreamOptions#

PropertyDescriptionTypeDefault
readableStreamReadable stream of binary dataReadableStream<Uint8Array>-
transformStreamSupport customizable transformStream to transform streamsTransformStream<string, T>sseTransformStream