Asynchronous streaming DEFLATE compression

Index
  • Flushes buffered uncompressed data. Useful to immediately retrieve the deflated output for small inputs.

    Parameters

    • Optionalsync: boolean

      Whether to flush to a byte boundary. A sync flush takes 4-5 extra bytes, but guarantees all pushed data is immediately decompressible. A separate DEFLATE stream may be concatenated with the current output after a sync flush.

    Returns void

  • Pushes a chunk to be deflated

    Parameters

    • chunk: Uint8Array

      The chunk to push

    • Optionalfinal: boolean

      Whether this is the last chunk

    Returns void

The handler to call whenever data is available

The handler to call whenever buffered source data is processed (i.e. queuedSize updates)

queuedSize: number

The number of uncompressed bytes buffered in the stream

terminate: AsyncTerminable

A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.