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

    Function flatMap

    • Map and flatten stream chunks

      Type Parameters

      • T
      • R

      Parameters

      • fn: (chunk: T) => SyncOrAsync<R[]>

        The transformation function that returns an array

      Returns TransformStream<T, R>

      A TransformStream that applies the transformation and flattens the result

      const stream = readable.pipeThrough(flatMap(word => word.split(''));