Skip to main content
Version: Next

ByteCounterStream

Callable

  • ByteCounterStream(__namedParameters): Transform

  • Creates a transform stream that logs the progress of the incoming data. This Transform calls the logProgress function every loggingInterval milliseconds with the number of bytes received so far.

    Can be used e.g. to log the progress of a download.


    Parameters

    • __namedParameters: { loggingInterval?: number; logTransferredBytes: (transferredBytes) => void }
      • optionalloggingInterval: number = 5000
      • logTransferredBytes: (transferredBytes) => void

    Returns Transform

    Transform stream logging the progress of the incoming data.