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

    Function map

    • Map function for transforming stream chunks

      Type Parameters

      • T
      • R

      Parameters

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

        The transformation function to apply to each chunk

      Returns TransformStream<T, R>

      A TransformStream that applies the transformation

      const stream = readable.pipeThrough(map(x => x * 2));