Web streams utils - v0.3.0
    Preparing search index...

    Function fromIterable

    • Create a ReadableStream from an iterable

      Type Parameters

      • T

      Parameters

      • iterable: Iterable<T, any, any> | AsyncIterable<T, any, any>

        The iterable or async iterable to convert to a stream

      Returns ReadableStream<T>

      A ReadableStream that emits items from the iterable

      const stream = fromIterable([1, 2, 3]);
      // or
      const stream = fromIterable(asyncGenerator());