Class AsyncCompress
Index
Constructors
constructor
- new AsyncCompress(
opts: GzipOptions,
cb?: AsyncFlateStreamHandler,
): AsyncCompress Creates an asynchronous GZIP stream
Parameters
- opts: GzipOptions
The compression options
Optional
cb: AsyncFlateStreamHandlerThe callback to call whenever data is deflated
Returns AsyncCompress
- opts: GzipOptions
- new AsyncCompress(cb?: AsyncFlateStreamHandler): AsyncCompress
Creates an asynchronous GZIP stream
Parameters
Optional
cb: AsyncFlateStreamHandlerThe callback to call whenever data is deflated
Returns AsyncCompress
Methods
flush
push
- push(chunk: Uint8Array<ArrayBufferLike>, final?: boolean): void
Pushes a chunk to be GZIPped
Parameters
- chunk: Uint8Array<ArrayBufferLike>
The chunk to push
Optional
final: booleanWhether this is the last chunk
Returns void
- chunk: Uint8Array<ArrayBufferLike>
Properties
ondata
The handler to call whenever data is available
Optional
ondrain
The handler to call whenever buffered source data is processed (i.e. queuedSize
updates)
queuedSize
queuedSize: number
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