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

    Function toArray

    • Collect all stream chunks into an array

      Type Parameters

      • T

      Parameters

      • stream: ReadableStream<T>

        The readable stream to collect

      Returns Promise<T[]>

      A promise that resolves to an array of all chunks

      const result = await toArray(readable);
      console.log(result); // [1, 2, 3, ...]