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

    Function filter

    • Filter function for filtering stream chunks

      Type Parameters

      • T

      Parameters

      • predicate: (chunk: T) => SyncOrAsync<boolean>

        The predicate function to determine which chunks to keep

      Returns TransformStream<T, T>

      A TransformStream that only passes chunks that satisfy the predicate

      const stream = readable.pipeThrough(filter(x => x > 10));