Class AsyncCompress
Index
Constructors
constructor
-
Creates an asynchronous GZIP stream
Parameters
- opts: GzipOptions
The compression options
Optionalcb: AsyncFlateStreamHandlerThe callback to call whenever data is deflated
Returns AsyncCompress
- opts: GzipOptions
-
Creates an asynchronous GZIP stream
Parameters
Optionalcb: AsyncFlateStreamHandlerThe callback to call whenever data is deflated
Returns AsyncCompress
Methods
flush
-
Flushes buffered uncompressed data. Useful to immediately retrieve the GZIPped output for small inputs.
Parameters
Optionalsync: booleanWhether to flush to a byte boundary. A sync flush takes 4-5 extra bytes, but guarantees all pushed data is immediately decompressible.
Returns void
push
-
Pushes a chunk to be GZIPped
Parameters
- chunk: Uint8Array
The chunk to push
Optionalfinal: booleanWhether this is the last chunk
Returns void
- chunk: Uint8Array
Properties
ondata
The handler to call whenever data is available
Optionalondrain
The handler to call whenever buffered source data is processed (i.e. queuedSize updates)
queuedSize
The number of uncompressed bytes buffered in the stream
terminate
A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.
Asynchronous streaming GZIP compression