cesr
    Preparing search index...

    Function parse

    • Parses CESR messages from an incoming stream of bytes.

      Parameters

      • input: ParseInput

        Input to the parser. Can be an Uint8Array, string or stream.

        Strings are treated as UTF-8 encoded data.

      • Optionaloptions: ParseOptions

        Parser options

      Returns AsyncIterableIterator<Message<MessageBody>>

      An async iterable of Message objects

      import { parse } from "cesr";

      const url = "https://example.com/oobi/EAQABAA..."; // URL returning a CESR stream
      const response = await fetch(url);

      if (response.body) {
      for await (const message of parse(response.body)) {
      console.log(message);
      }
      }