Function withCounter

  • Adds a counter representing the amount of chunks received thus far.

    Type Parameters

    • T

    Parameters

    • start: number = 0

    Returns TransformStream<T, {
        chunk: T;
        counter: number;
    }>

    Example

    --a----------------------b-------|

    withCounter()

    --{chunk:'a',counter:0}--{chunk:'b',counter:1}-|

Generated using TypeDoc