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

    Function tap

    • Tap function for side effects without modifying the stream

      Type Parameters

      • T

      Parameters

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

        The function to execute for each chunk (for side effects)

      Returns TransformStream<T, T>

      A TransformStream that passes chunks unchanged after executing the function

      const stream = readable.pipeThrough(tap(x => console.log(`Processing: ${x}`)));