unzip.md 1.6 KB

Class: Unzip

A ZIP archive decompression stream that emits files as they are discovered

Hierarchy

  • Unzip

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Unzip(cb?: UnzipFileHandler): Unzip

Creates a ZIP decompression stream

Parameters:

Name Type Description
cb? UnzipFileHandler The callback to call whenever a file in the ZIP archive is found

Returns: Unzip

Properties

onfile

onfile: UnzipFileHandler

The handler to call whenever a file is discovered

Methods

push

push(chunk: Uint8Array, final: boolean): any

Pushes a chunk to be unzipped

Parameters:

Name Type Description
chunk Uint8Array The chunk to push
final boolean Whether this is the last chunk

Returns: any


register

register(decoder: UnzipDecoderConstructor): void

Registers a decoder with the stream, allowing for files compressed with the compression type provided to be expanded correctly

Parameters:

Name Type Description
decoder UnzipDecoderConstructor The decoder constructor

Returns: void