diff options
Diffstat (limited to 'docs')
49 files changed, 4284 insertions, 0 deletions
diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..de468d5 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,719 @@ +# fflate + +## Index + +### Classes + +* [AsyncDecompress](classes/asyncdecompress.md) +* [AsyncDeflate](classes/asyncdeflate.md) +* [AsyncGunzip](classes/asyncgunzip.md) +* [AsyncGzip](classes/asyncgzip.md) +* [AsyncInflate](classes/asyncinflate.md) +* [AsyncUnzipInflate](classes/asyncunzipinflate.md) +* [AsyncUnzlib](classes/asyncunzlib.md) +* [AsyncZipDeflate](classes/asynczipdeflate.md) +* [AsyncZlib](classes/asynczlib.md) +* [DecodeUTF8](classes/decodeutf8.md) +* [Decompress](classes/decompress.md) +* [Deflate](classes/deflate.md) +* [EncodeUTF8](classes/encodeutf8.md) +* [Gunzip](classes/gunzip.md) +* [Gzip](classes/gzip.md) +* [Inflate](classes/inflate.md) +* [Unzip](classes/unzip.md) +* [UnzipInflate](classes/unzipinflate.md) +* [UnzipPassThrough](classes/unzippassthrough.md) +* [Unzlib](classes/unzlib.md) +* [Zip](classes/zip.md) +* [ZipDeflate](classes/zipdeflate.md) +* [ZipPassThrough](classes/zippassthrough.md) +* [Zlib](classes/zlib.md) + +### Interfaces + +* [AsyncDeflateOptions](interfaces/asyncdeflateoptions.md) +* [AsyncGunzipOptions](interfaces/asyncgunzipoptions.md) +* [AsyncGzipOptions](interfaces/asyncgzipoptions.md) +* [AsyncInflateOptions](interfaces/asyncinflateoptions.md) +* [AsyncTerminable](interfaces/asyncterminable.md) +* [AsyncUnzipOptions](interfaces/asyncunzipoptions.md) +* [AsyncUnzlibOptions](interfaces/asyncunzliboptions.md) +* [AsyncZipOptions](interfaces/asynczipoptions.md) +* [AsyncZippable](interfaces/asynczippable.md) +* [AsyncZlibOptions](interfaces/asynczliboptions.md) +* [DeflateOptions](interfaces/deflateoptions.md) +* [FlateError](interfaces/flateerror.md) +* [GzipOptions](interfaces/gzipoptions.md) +* [UnzipDecoder](interfaces/unzipdecoder.md) +* [UnzipDecoderConstructor](interfaces/unzipdecoderconstructor.md) +* [UnzipFile](interfaces/unzipfile.md) +* [UnzipFileInfo](interfaces/unzipfileinfo.md) +* [UnzipOptions](interfaces/unzipoptions.md) +* [Unzipped](interfaces/unzipped.md) +* [ZipAttributes](interfaces/zipattributes.md) +* [ZipInputFile](interfaces/zipinputfile.md) +* [ZipOptions](interfaces/zipoptions.md) +* [Zippable](interfaces/zippable.md) +* [ZlibOptions](interfaces/zliboptions.md) + +### Type aliases + +* [AsyncFlateStreamHandler](README.md#asyncflatestreamhandler) +* [AsyncZippableFile](README.md#asynczippablefile) +* [FlateCallback](README.md#flatecallback) +* [FlateStreamHandler](README.md#flatestreamhandler) +* [StringStreamHandler](README.md#stringstreamhandler) +* [UnzipCallback](README.md#unzipcallback) +* [UnzipFileFilter](README.md#unzipfilefilter) +* [UnzipFileHandler](README.md#unzipfilehandler) +* [ZippableFile](README.md#zippablefile) + +### Variables + +* [FlateErrorCode](README.md#flateerrorcode) + +### Functions + +* [decompress](README.md#decompress) +* [decompressSync](README.md#decompresssync) +* [deflate](README.md#deflate) +* [deflateSync](README.md#deflatesync) +* [gunzip](README.md#gunzip) +* [gunzipSync](README.md#gunzipsync) +* [gzip](README.md#gzip) +* [gzipSync](README.md#gzipsync) +* [inflate](README.md#inflate) +* [inflateSync](README.md#inflatesync) +* [strFromU8](README.md#strfromu8) +* [strToU8](README.md#strtou8) +* [unzip](README.md#unzip) +* [unzipSync](README.md#unzipsync) +* [unzlib](README.md#unzlib) +* [unzlibSync](README.md#unzlibsync) +* [zip](README.md#zip) +* [zipSync](README.md#zipsync) +* [zlib](README.md#zlib) +* [zlibSync](README.md#zlibsync) + +## Type aliases + +### AsyncFlateStreamHandler + +Ƭ **AsyncFlateStreamHandler**: (err: [FlateError](interfaces/flateerror.md),data: Uint8Array,final: boolean) => void + +Handler for asynchronous data (de)compression streams + +**`param`** Any error that occurred + +**`param`** The data output from the stream processor + +**`param`** Whether this is the final block + +___ + +### AsyncZippableFile + +Ƭ **AsyncZippableFile**: Uint8Array \| [] + +A file that can be used to asynchronously create a ZIP archive + +___ + +### FlateCallback + +Ƭ **FlateCallback**: (err: [FlateError](interfaces/flateerror.md),data: Uint8Array) => void + +Callback for asynchronous (de)compression methods + +**`param`** Any error that occurred + +**`param`** The resulting data. Only present if `err` is null + +___ + +### FlateStreamHandler + +Ƭ **FlateStreamHandler**: (data: Uint8Array,final: boolean) => void + +Handler for data (de)compression streams + +**`param`** The data output from the stream processor + +**`param`** Whether this is the final block + +___ + +### StringStreamHandler + +Ƭ **StringStreamHandler**: (data: string,final: boolean) => void + +Handler for string generation streams + +**`param`** The string output from the stream processor + +**`param`** Whether this is the final block + +___ + +### UnzipCallback + +Ƭ **UnzipCallback**: (err: [FlateError](interfaces/flateerror.md),data: [Unzipped](interfaces/unzipped.md)) => void + +Callback for asynchronous ZIP decompression + +**`param`** Any error that occurred + +**`param`** The decompressed ZIP archive + +___ + +### UnzipFileFilter + +Ƭ **UnzipFileFilter**: (file: [UnzipFileInfo](interfaces/unzipfileinfo.md)) => boolean + +A filter for files to be extracted during the unzipping process + +**`param`** The info for the current file being processed + +**`returns`** Whether or not to extract the current file + +___ + +### UnzipFileHandler + +Ƭ **UnzipFileHandler**: (file: [UnzipFile](interfaces/unzipfile.md)) => void + +Handler for streaming ZIP decompression + +**`param`** The file that was found in the archive + +___ + +### ZippableFile + +Ƭ **ZippableFile**: Uint8Array \| [] + +A file that can be used to create a ZIP archive + +## Variables + +### FlateErrorCode + +• `Const` **FlateErrorCode**: object = { UnexpectedEOF: 0, InvalidBlockType: 1, InvalidLengthLiteral: 2, InvalidDistance: 3, StreamFinished: 4, NoStreamHandler: 5, InvalidHeader: 6, NoCallback: 7, InvalidUTF8: 8, ExtraFieldTooLong: 9, InvalidDate: 10, FilenameTooLong: 11, StreamFinishing: 12, InvalidZipData: 13, UnknownCompressionMethod: 14} as const + +Codes for errors generated within this library + +#### Type declaration: + +Name | Type | +------ | ------ | +`ExtraFieldTooLong` | 9 | +`FilenameTooLong` | 11 | +`InvalidBlockType` | 1 | +`InvalidDate` | 10 | +`InvalidDistance` | 3 | +`InvalidHeader` | 6 | +`InvalidLengthLiteral` | 2 | +`InvalidUTF8` | 8 | +`InvalidZipData` | 13 | +`NoCallback` | 7 | +`NoStreamHandler` | 5 | +`StreamFinished` | 4 | +`StreamFinishing` | 12 | +`UnexpectedEOF` | 0 | +`UnknownCompressionMethod` | 14 | + +## Functions + +### decompress + +▸ **decompress**(`data`: Uint8Array, `opts`: [AsyncInflateOptions](interfaces/asyncinflateoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`opts` | [AsyncInflateOptions](interfaces/asyncinflateoptions.md) | The decompression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **decompress**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### decompressSync + +▸ **decompressSync**(`data`: Uint8Array, `out?`: Uint8Array): Uint8Array + +Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`out?` | Uint8Array | Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length. | + +**Returns:** Uint8Array + +___ + +### deflate + +▸ **deflate**(`data`: Uint8Array, `opts`: [AsyncDeflateOptions](interfaces/asyncdeflateoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with DEFLATE without any wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts` | [AsyncDeflateOptions](interfaces/asyncdeflateoptions.md) | The compression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **deflate**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with DEFLATE without any wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### deflateSync + +▸ **deflateSync**(`data`: Uint8Array, `opts?`: [DeflateOptions](interfaces/deflateoptions.md)): Uint8Array + +Compresses data with DEFLATE without any wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts?` | [DeflateOptions](interfaces/deflateoptions.md) | The compression options | + +**Returns:** Uint8Array + +___ + +### gunzip + +▸ **gunzip**(`data`: Uint8Array, `opts`: [AsyncGunzipOptions](interfaces/asyncgunzipoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands GZIP data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`opts` | [AsyncGunzipOptions](interfaces/asyncgunzipoptions.md) | The decompression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **gunzip**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands GZIP data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### gunzipSync + +▸ **gunzipSync**(`data`: Uint8Array, `out?`: Uint8Array): Uint8Array + +Expands GZIP data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`out?` | Uint8Array | Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory. | + +**Returns:** Uint8Array + +___ + +### gzip + +▸ **gzip**(`data`: Uint8Array, `opts`: [AsyncGzipOptions](interfaces/asyncgzipoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with GZIP + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts` | [AsyncGzipOptions](interfaces/asyncgzipoptions.md) | The compression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **gzip**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with GZIP + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **gzip**(`data`: Uint8Array, `opts`: [AsyncGzipOptions](interfaces/asyncgzipoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with GZIP + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts` | [AsyncGzipOptions](interfaces/asyncgzipoptions.md) | The compression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **gzip**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with GZIP + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### gzipSync + +▸ **gzipSync**(`data`: Uint8Array, `opts?`: [GzipOptions](interfaces/gzipoptions.md)): Uint8Array + +Compresses data with GZIP + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts?` | [GzipOptions](interfaces/gzipoptions.md) | The compression options | + +**Returns:** Uint8Array + +___ + +### inflate + +▸ **inflate**(`data`: Uint8Array, `opts`: [AsyncInflateOptions](interfaces/asyncinflateoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands DEFLATE data with no wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`opts` | [AsyncInflateOptions](interfaces/asyncinflateoptions.md) | The decompression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **inflate**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands DEFLATE data with no wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### inflateSync + +▸ **inflateSync**(`data`: Uint8Array, `out?`: Uint8Array): Uint8Array + +Expands DEFLATE data with no wrapper + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`out?` | Uint8Array | Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length. | + +**Returns:** Uint8Array + +___ + +### strFromU8 + +▸ **strFromU8**(`dat`: Uint8Array, `latin1?`: boolean): string + +Converts a Uint8Array to a string + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`dat` | Uint8Array | The data to decode to string | +`latin1?` | boolean | Whether or not to interpret the data as Latin-1. This should not need to be true unless encoding to binary string. | + +**Returns:** string + +___ + +### strToU8 + +▸ **strToU8**(`str`: string, `latin1?`: boolean): Uint8Array + +Converts a string into a Uint8Array for use with compression/decompression methods + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`str` | string | The string to encode | +`latin1?` | boolean | Whether or not to interpret the data as Latin-1. This should not need to be true unless decoding a binary string. | + +**Returns:** Uint8Array + +___ + +### unzip + +▸ **unzip**(`data`: Uint8Array, `opts`: [AsyncUnzipOptions](interfaces/asyncunzipoptions.md), `cb`: [UnzipCallback](README.md#unzipcallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously decompresses a ZIP archive + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The raw compressed ZIP file | +`opts` | [AsyncUnzipOptions](interfaces/asyncunzipoptions.md) | The ZIP extraction options | +`cb` | [UnzipCallback](README.md#unzipcallback) | The callback to call with the decompressed files | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **unzip**(`data`: Uint8Array, `cb`: [UnzipCallback](README.md#unzipcallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously decompresses a ZIP archive + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The raw compressed ZIP file | +`cb` | [UnzipCallback](README.md#unzipcallback) | The callback to call with the decompressed files | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### unzipSync + +▸ **unzipSync**(`data`: Uint8Array, `opts?`: [UnzipOptions](interfaces/unzipoptions.md)): [Unzipped](interfaces/unzipped.md) + +Synchronously decompresses a ZIP archive. Prefer using `unzip` for better +performance with more than one file. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The raw compressed ZIP file | +`opts?` | [UnzipOptions](interfaces/unzipoptions.md) | The ZIP extraction options | + +**Returns:** [Unzipped](interfaces/unzipped.md) + +___ + +### unzlib + +▸ **unzlib**(`data`: Uint8Array, `opts`: [AsyncGunzipOptions](interfaces/asyncgunzipoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands Zlib data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`opts` | [AsyncGunzipOptions](interfaces/asyncgunzipoptions.md) | The decompression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **unzlib**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously expands Zlib data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon decompression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### unzlibSync + +▸ **unzlibSync**(`data`: Uint8Array, `out?`: Uint8Array): Uint8Array + +Expands Zlib data + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to decompress | +`out?` | Uint8Array | Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length. | + +**Returns:** Uint8Array + +___ + +### zip + +▸ **zip**(`data`: [AsyncZippable](interfaces/asynczippable.md), `opts`: [AsyncZipOptions](interfaces/asynczipoptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously creates a ZIP file + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | [AsyncZippable](interfaces/asynczippable.md) | The directory structure for the ZIP archive | +`opts` | [AsyncZipOptions](interfaces/asynczipoptions.md) | The main options, merged with per-file options | +`cb` | [FlateCallback](README.md#flatecallback) | The callback to call with the generated ZIP archive | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **zip**(`data`: [AsyncZippable](interfaces/asynczippable.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously creates a ZIP file + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | [AsyncZippable](interfaces/asynczippable.md) | The directory structure for the ZIP archive | +`cb` | [FlateCallback](README.md#flatecallback) | The callback to call with the generated ZIP archive | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### zipSync + +▸ **zipSync**(`data`: [Zippable](interfaces/zippable.md), `opts?`: [ZipOptions](interfaces/zipoptions.md)): Uint8Array + +Synchronously creates a ZIP file. Prefer using `zip` for better performance +with more than one file. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | [Zippable](interfaces/zippable.md) | The directory structure for the ZIP archive | +`opts?` | [ZipOptions](interfaces/zipoptions.md) | The main options, merged with per-file options | + +**Returns:** Uint8Array + +___ + +### zlib + +▸ **zlib**(`data`: Uint8Array, `opts`: [AsyncZlibOptions](interfaces/asynczliboptions.md), `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with Zlib + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts` | [AsyncZlibOptions](interfaces/asynczliboptions.md) | The compression options | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +▸ **zlib**(`data`: Uint8Array, `cb`: [FlateCallback](README.md#flatecallback)): [AsyncTerminable](interfaces/asyncterminable.md) + +Asynchronously compresses data with Zlib + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`cb` | [FlateCallback](README.md#flatecallback) | The function to be called upon compression completion | + +**Returns:** [AsyncTerminable](interfaces/asyncterminable.md) + +___ + +### zlibSync + +▸ **zlibSync**(`data`: Uint8Array, `opts?`: [ZlibOptions](interfaces/zliboptions.md)): Uint8Array + +Compress data with Zlib + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data to compress | +`opts?` | [ZlibOptions](interfaces/zliboptions.md) | The compression options | + +**Returns:** Uint8Array diff --git a/docs/classes/asyncdecompress.md b/docs/classes/asyncdecompress.md new file mode 100644 index 0000000..9073472 --- /dev/null +++ b/docs/classes/asyncdecompress.md @@ -0,0 +1,62 @@ +# Class: AsyncDecompress + +Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression + +## Hierarchy + +* **AsyncDecompress** + +## Index + +### Constructors + +* [constructor](asyncdecompress.md#constructor) + +### Properties + +* [ondata](asyncdecompress.md#ondata) + +### Methods + +* [push](asyncdecompress.md#push) + +## Constructors + +### constructor + +\+ **new AsyncDecompress**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncDecompress](asyncdecompress.md) + +Creates an asynchronous decompression stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is decompressed | + +**Returns:** [AsyncDecompress](asyncdecompress.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be decompressed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asyncdeflate.md b/docs/classes/asyncdeflate.md new file mode 100644 index 0000000..b4a36bf --- /dev/null +++ b/docs/classes/asyncdeflate.md @@ -0,0 +1,85 @@ +# Class: AsyncDeflate + +Asynchronous streaming DEFLATE compression + +## Hierarchy + +* **AsyncDeflate** + +## Index + +### Constructors + +* [constructor](asyncdeflate.md#constructor) + +### Properties + +* [ondata](asyncdeflate.md#ondata) +* [terminate](asyncdeflate.md#terminate) + +### Methods + +* [push](asyncdeflate.md#push) + +## Constructors + +### constructor + +\+ **new AsyncDeflate**(`opts`: [DeflateOptions](../interfaces/deflateoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncDeflate](asyncdeflate.md) + +Creates an asynchronous DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [DeflateOptions](../interfaces/deflateoptions.md) | The compression options | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncDeflate](asyncdeflate.md) + +\+ **new AsyncDeflate**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncDeflate](asyncdeflate.md) + +Creates an asynchronous DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncDeflate](asyncdeflate.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be deflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asyncgunzip.md b/docs/classes/asyncgunzip.md new file mode 100644 index 0000000..14c48ce --- /dev/null +++ b/docs/classes/asyncgunzip.md @@ -0,0 +1,72 @@ +# Class: AsyncGunzip + +Asynchronous streaming GZIP decompression + +## Hierarchy + +* **AsyncGunzip** + +## Index + +### Constructors + +* [constructor](asyncgunzip.md#constructor) + +### Properties + +* [ondata](asyncgunzip.md#ondata) +* [terminate](asyncgunzip.md#terminate) + +### Methods + +* [push](asyncgunzip.md#push) + +## Constructors + +### constructor + +\+ **new AsyncGunzip**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGunzip](asyncgunzip.md) + +Creates an asynchronous GUNZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncGunzip](asyncgunzip.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be GUNZIPped + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asyncgzip.md b/docs/classes/asyncgzip.md new file mode 100644 index 0000000..66d1cf1 --- /dev/null +++ b/docs/classes/asyncgzip.md @@ -0,0 +1,127 @@ +# Class: AsyncGzip + +Asynchronous streaming GZIP compression +Asynchronous streaming GZIP compression + +## Hierarchy + +* **AsyncGzip** + +## Index + +### Constructors + +* [constructor](asyncgzip.md#constructor) + +### Properties + +* [ondata](asyncgzip.md#ondata) +* [terminate](asyncgzip.md#terminate) + +### Methods + +* [push](asyncgzip.md#push) + +## Constructors + +### constructor + +\+ **new AsyncGzip**(`opts`: [GzipOptions](../interfaces/gzipoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGzip](asyncgzip.md) + +Creates an asynchronous GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [GzipOptions](../interfaces/gzipoptions.md) | The compression options | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncGzip](asyncgzip.md) + +\+ **new AsyncGzip**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGzip](asyncgzip.md) + +Creates an asynchronous GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncGzip](asyncgzip.md) + +\+ **new AsyncGzip**(`opts`: [GzipOptions](../interfaces/gzipoptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGzip](asyncgzip.md) + +Creates an asynchronous GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [GzipOptions](../interfaces/gzipoptions.md) | The compression options | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncGzip](asyncgzip.md) + +\+ **new AsyncGzip**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncGzip](asyncgzip.md) + +Creates an asynchronous GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncGzip](asyncgzip.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be GZIPped + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be GZIPped + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asyncinflate.md b/docs/classes/asyncinflate.md new file mode 100644 index 0000000..19b4266 --- /dev/null +++ b/docs/classes/asyncinflate.md @@ -0,0 +1,72 @@ +# Class: AsyncInflate + +Asynchronous streaming DEFLATE decompression + +## Hierarchy + +* **AsyncInflate** + +## Index + +### Constructors + +* [constructor](asyncinflate.md#constructor) + +### Properties + +* [ondata](asyncinflate.md#ondata) +* [terminate](asyncinflate.md#terminate) + +### Methods + +* [push](asyncinflate.md#push) + +## Constructors + +### constructor + +\+ **new AsyncInflate**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncInflate](asyncinflate.md) + +Creates an asynchronous inflation stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncInflate](asyncinflate.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be inflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asyncunzipinflate.md b/docs/classes/asyncunzipinflate.md new file mode 100644 index 0000000..befe5f1 --- /dev/null +++ b/docs/classes/asyncunzipinflate.md @@ -0,0 +1,83 @@ +# Class: AsyncUnzipInflate + +Asynchronous streaming DEFLATE decompression for ZIP archives + +## Hierarchy + +* **AsyncUnzipInflate** + +## Implements + +* [UnzipDecoder](../interfaces/unzipdecoder.md) + +## Index + +### Constructors + +* [constructor](asyncunzipinflate.md#constructor) + +### Properties + +* [ondata](asyncunzipinflate.md#ondata) +* [terminate](asyncunzipinflate.md#terminate) +* [compression](asyncunzipinflate.md#compression) + +### Methods + +* [push](asyncunzipinflate.md#push) + +## Constructors + +### constructor + +\+ **new AsyncUnzipInflate**(`_`: string, `sz?`: number): [AsyncUnzipInflate](asyncunzipinflate.md) + +Creates a DEFLATE decompression that can be used in ZIP archives + +#### Parameters: + +Name | Type | +------ | ------ | +`_` | string | +`sz?` | number | + +**Returns:** [AsyncUnzipInflate](asyncunzipinflate.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md).[ondata](../interfaces/unzipdecoder.md#ondata)* + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md).[terminate](../interfaces/unzipdecoder.md#terminate)* + +___ + +### compression + +▪ `Static` **compression**: number = 8 + +## Methods + +### push + +▸ **push**(`data`: Uint8Array, `final`: boolean): void + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md)* + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | Uint8Array | +`final` | boolean | + +**Returns:** void diff --git a/docs/classes/asyncunzlib.md b/docs/classes/asyncunzlib.md new file mode 100644 index 0000000..70d067d --- /dev/null +++ b/docs/classes/asyncunzlib.md @@ -0,0 +1,72 @@ +# Class: AsyncUnzlib + +Asynchronous streaming Zlib decompression + +## Hierarchy + +* **AsyncUnzlib** + +## Index + +### Constructors + +* [constructor](asyncunzlib.md#constructor) + +### Properties + +* [ondata](asyncunzlib.md#ondata) +* [terminate](asyncunzlib.md#terminate) + +### Methods + +* [push](asyncunzlib.md#push) + +## Constructors + +### constructor + +\+ **new AsyncUnzlib**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncUnzlib](asyncunzlib.md) + +Creates an asynchronous Zlib decompression stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncUnzlib](asyncunzlib.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be decompressed from Zlib + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asynczipdeflate.md b/docs/classes/asynczipdeflate.md new file mode 100644 index 0000000..e46b113 --- /dev/null +++ b/docs/classes/asynczipdeflate.md @@ -0,0 +1,182 @@ +# Class: AsyncZipDeflate + +Asynchronous streaming DEFLATE compression for ZIP archives + +## Hierarchy + +* **AsyncZipDeflate** + +## Implements + +* [ZipInputFile](../interfaces/zipinputfile.md) + +## Index + +### Constructors + +* [constructor](asynczipdeflate.md#constructor) + +### Properties + +* [attrs](asynczipdeflate.md#attrs) +* [comment](asynczipdeflate.md#comment) +* [compression](asynczipdeflate.md#compression) +* [crc](asynczipdeflate.md#crc) +* [extra](asynczipdeflate.md#extra) +* [filename](asynczipdeflate.md#filename) +* [flag](asynczipdeflate.md#flag) +* [mtime](asynczipdeflate.md#mtime) +* [ondata](asynczipdeflate.md#ondata) +* [os](asynczipdeflate.md#os) +* [size](asynczipdeflate.md#size) +* [terminate](asynczipdeflate.md#terminate) + +### Methods + +* [process](asynczipdeflate.md#process) +* [push](asynczipdeflate.md#push) + +## Constructors + +### constructor + +\+ **new AsyncZipDeflate**(`filename`: string, `opts?`: [DeflateOptions](../interfaces/deflateoptions.md)): [AsyncZipDeflate](asynczipdeflate.md) + +Creates a DEFLATE stream that can be added to ZIP archives + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`filename` | string | The filename to associate with this data stream | +`opts?` | [DeflateOptions](../interfaces/deflateoptions.md) | The compression options | + +**Returns:** [AsyncZipDeflate](asynczipdeflate.md) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[attrs](../interfaces/zipinputfile.md#attrs)* + +___ + +### comment + +• `Optional` **comment**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[comment](../interfaces/zipinputfile.md#comment)* + +___ + +### compression + +• **compression**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[compression](../interfaces/zipinputfile.md#compression)* + +___ + +### crc + +• **crc**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[crc](../interfaces/zipinputfile.md#crc)* + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[extra](../interfaces/zipinputfile.md#extra)* + +___ + +### filename + +• **filename**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[filename](../interfaces/zipinputfile.md#filename)* + +___ + +### flag + +• **flag**: 0 \| 1 \| 2 \| 3 + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[flag](../interfaces/zipinputfile.md#flag)* + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[mtime](../interfaces/zipinputfile.md#mtime)* + +___ + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[ondata](../interfaces/zipinputfile.md#ondata)* + +___ + +### os + +• `Optional` **os**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[os](../interfaces/zipinputfile.md#os)* + +___ + +### size + +• **size**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[size](../interfaces/zipinputfile.md#size)* + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[terminate](../interfaces/zipinputfile.md#terminate)* + +## Methods + +### process + +▸ **process**(`chunk`: Uint8Array, `final`: boolean): void + +#### Parameters: + +Name | Type | +------ | ------ | +`chunk` | Uint8Array | +`final` | boolean | + +**Returns:** void + +___ + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be deflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/asynczlib.md b/docs/classes/asynczlib.md new file mode 100644 index 0000000..f3975fc --- /dev/null +++ b/docs/classes/asynczlib.md @@ -0,0 +1,85 @@ +# Class: AsyncZlib + +Asynchronous streaming Zlib compression + +## Hierarchy + +* **AsyncZlib** + +## Index + +### Constructors + +* [constructor](asynczlib.md#constructor) + +### Properties + +* [ondata](asynczlib.md#ondata) +* [terminate](asynczlib.md#terminate) + +### Methods + +* [push](asynczlib.md#push) + +## Constructors + +### constructor + +\+ **new AsyncZlib**(`opts`: [ZlibOptions](../interfaces/zliboptions.md), `cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncZlib](asynczlib.md) + +Creates an asynchronous DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [ZlibOptions](../interfaces/zliboptions.md) | The compression options | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncZlib](asynczlib.md) + +\+ **new AsyncZlib**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [AsyncZlib](asynczlib.md) + +Creates an asynchronous DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [AsyncZlib](asynczlib.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• **terminate**: [AsyncTerminable](../interfaces/asyncterminable.md) + +A method to terminate the stream's internal worker. Subsequent calls to +push() will silently fail. + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be deflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/decodeutf8.md b/docs/classes/decodeutf8.md new file mode 100644 index 0000000..ca98064 --- /dev/null +++ b/docs/classes/decodeutf8.md @@ -0,0 +1,62 @@ +# Class: DecodeUTF8 + +Streaming UTF-8 decoding + +## Hierarchy + +* **DecodeUTF8** + +## Index + +### Constructors + +* [constructor](decodeutf8.md#constructor) + +### Properties + +* [ondata](decodeutf8.md#ondata) + +### Methods + +* [push](decodeutf8.md#push) + +## Constructors + +### constructor + +\+ **new DecodeUTF8**(`cb?`: [StringStreamHandler](../README.md#stringstreamhandler)): [DecodeUTF8](decodeutf8.md) + +Creates a UTF-8 decoding stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [StringStreamHandler](../README.md#stringstreamhandler) | The callback to call whenever data is decoded | + +**Returns:** [DecodeUTF8](decodeutf8.md) + +## Properties + +### ondata + +• **ondata**: [StringStreamHandler](../README.md#stringstreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be decoded from UTF-8 binary + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/decompress.md b/docs/classes/decompress.md new file mode 100644 index 0000000..0e45e5b --- /dev/null +++ b/docs/classes/decompress.md @@ -0,0 +1,62 @@ +# Class: Decompress + +Streaming GZIP, Zlib, or raw DEFLATE decompression + +## Hierarchy + +* **Decompress** + +## Index + +### Constructors + +* [constructor](decompress.md#constructor) + +### Properties + +* [ondata](decompress.md#ondata) + +### Methods + +* [push](decompress.md#push) + +## Constructors + +### constructor + +\+ **new Decompress**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Decompress](decompress.md) + +Creates a decompression stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is decompressed | + +**Returns:** [Decompress](decompress.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be decompressed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/deflate.md b/docs/classes/deflate.md new file mode 100644 index 0000000..3b9195a --- /dev/null +++ b/docs/classes/deflate.md @@ -0,0 +1,75 @@ +# Class: Deflate + +Streaming DEFLATE compression + +## Hierarchy + +* **Deflate** + +## Index + +### Constructors + +* [constructor](deflate.md#constructor) + +### Properties + +* [ondata](deflate.md#ondata) + +### Methods + +* [push](deflate.md#push) + +## Constructors + +### constructor + +\+ **new Deflate**(`opts`: [DeflateOptions](../interfaces/deflateoptions.md), `cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Deflate](deflate.md) + +Creates a DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [DeflateOptions](../interfaces/deflateoptions.md) | The compression options | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Deflate](deflate.md) + +\+ **new Deflate**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Deflate](deflate.md) + +Creates a DEFLATE stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Deflate](deflate.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be deflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/encodeutf8.md b/docs/classes/encodeutf8.md new file mode 100644 index 0000000..3fd2c4b --- /dev/null +++ b/docs/classes/encodeutf8.md @@ -0,0 +1,62 @@ +# Class: EncodeUTF8 + +Streaming UTF-8 encoding + +## Hierarchy + +* **EncodeUTF8** + +## Index + +### Constructors + +* [constructor](encodeutf8.md#constructor) + +### Properties + +* [ondata](encodeutf8.md#ondata) + +### Methods + +* [push](encodeutf8.md#push) + +## Constructors + +### constructor + +\+ **new EncodeUTF8**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [EncodeUTF8](encodeutf8.md) + +Creates a UTF-8 decoding stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is encoded | + +**Returns:** [EncodeUTF8](encodeutf8.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: string, `final?`: boolean): void + +Pushes a chunk to be encoded to UTF-8 + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | string | The string data to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/gunzip.md b/docs/classes/gunzip.md new file mode 100644 index 0000000..8299350 --- /dev/null +++ b/docs/classes/gunzip.md @@ -0,0 +1,62 @@ +# Class: Gunzip + +Streaming GZIP decompression + +## Hierarchy + +* **Gunzip** + +## Index + +### Constructors + +* [constructor](gunzip.md#constructor) + +### Properties + +* [ondata](gunzip.md#ondata) + +### Methods + +* [push](gunzip.md#push) + +## Constructors + +### constructor + +\+ **new Gunzip**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Gunzip](gunzip.md) + +Creates a GUNZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is inflated | + +**Returns:** [Gunzip](gunzip.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be GUNZIPped + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/gzip.md b/docs/classes/gzip.md new file mode 100644 index 0000000..2cbc2a1 --- /dev/null +++ b/docs/classes/gzip.md @@ -0,0 +1,102 @@ +# Class: Gzip + +Streaming GZIP compression +Streaming GZIP compression + +## Hierarchy + +* **Gzip** + +## Index + +### Constructors + +* [constructor](gzip.md#constructor) + +### Properties + +* [ondata](gzip.md#ondata) + +### Methods + +* [push](gzip.md#push) + +## Constructors + +### constructor + +\+ **new Gzip**(`opts`: [GzipOptions](../interfaces/gzipoptions.md), `cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Gzip](gzip.md) + +Creates a GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [GzipOptions](../interfaces/gzipoptions.md) | The compression options | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Gzip](gzip.md) + +\+ **new Gzip**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Gzip](gzip.md) + +Creates a GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Gzip](gzip.md) + +\+ **new Gzip**(`opts`: [GzipOptions](../interfaces/gzipoptions.md), `cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Gzip](gzip.md) + +Creates a GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [GzipOptions](../interfaces/gzipoptions.md) | The compression options | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Gzip](gzip.md) + +\+ **new Gzip**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Gzip](gzip.md) + +Creates a GZIP stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Gzip](gzip.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be GZIPped + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/inflate.md b/docs/classes/inflate.md new file mode 100644 index 0000000..72cdcba --- /dev/null +++ b/docs/classes/inflate.md @@ -0,0 +1,62 @@ +# Class: Inflate + +Streaming DEFLATE decompression + +## Hierarchy + +* **Inflate** + +## Index + +### Constructors + +* [constructor](inflate.md#constructor) + +### Properties + +* [ondata](inflate.md#ondata) + +### Methods + +* [push](inflate.md#push) + +## Constructors + +### constructor + +\+ **new Inflate**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Inflate](inflate.md) + +Creates an inflation stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is inflated | + +**Returns:** [Inflate](inflate.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be inflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the final chunk | + +**Returns:** void diff --git a/docs/classes/unzip.md b/docs/classes/unzip.md new file mode 100644 index 0000000..d0f8292 --- /dev/null +++ b/docs/classes/unzip.md @@ -0,0 +1,80 @@ +# Class: Unzip + +A ZIP archive decompression stream that emits files as they are discovered + +## Hierarchy + +* **Unzip** + +## Index + +### Constructors + +* [constructor](unzip.md#constructor) + +### Properties + +* [onfile](unzip.md#onfile) + +### Methods + +* [push](unzip.md#push) +* [register](unzip.md#register) + +## Constructors + +### constructor + +\+ **new Unzip**(`cb?`: [UnzipFileHandler](../README.md#unzipfilehandler)): [Unzip](unzip.md) + +Creates a ZIP decompression stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [UnzipFileHandler](../README.md#unzipfilehandler) | The callback to call whenever a file in the ZIP archive is found | + +**Returns:** [Unzip](unzip.md) + +## Properties + +### onfile + +• **onfile**: [UnzipFileHandler](../README.md#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](../interfaces/unzipdecoderconstructor.md)): 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](../interfaces/unzipdecoderconstructor.md) | The decoder constructor | + +**Returns:** void diff --git a/docs/classes/unzipinflate.md b/docs/classes/unzipinflate.md new file mode 100644 index 0000000..0da5623 --- /dev/null +++ b/docs/classes/unzipinflate.md @@ -0,0 +1,68 @@ +# Class: UnzipInflate + +Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for +better performance. + +## Hierarchy + +* **UnzipInflate** + +## Implements + +* [UnzipDecoder](../interfaces/unzipdecoder.md) + +## Index + +### Constructors + +* [constructor](unzipinflate.md#constructor) + +### Properties + +* [ondata](unzipinflate.md#ondata) +* [compression](unzipinflate.md#compression) + +### Methods + +* [push](unzipinflate.md#push) + +## Constructors + +### constructor + +\+ **new UnzipInflate**(): [UnzipInflate](unzipinflate.md) + +Creates a DEFLATE decompression that can be used in ZIP archives + +**Returns:** [UnzipInflate](unzipinflate.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md).[ondata](../interfaces/unzipdecoder.md#ondata)* + +___ + +### compression + +▪ `Static` **compression**: number = 8 + +## Methods + +### push + +▸ **push**(`data`: Uint8Array, `final`: boolean): void + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md)* + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | Uint8Array | +`final` | boolean | + +**Returns:** void diff --git a/docs/classes/unzippassthrough.md b/docs/classes/unzippassthrough.md new file mode 100644 index 0000000..5e59eb9 --- /dev/null +++ b/docs/classes/unzippassthrough.md @@ -0,0 +1,53 @@ +# Class: UnzipPassThrough + +Streaming pass-through decompression for ZIP archives + +## Hierarchy + +* **UnzipPassThrough** + +## Implements + +* [UnzipDecoder](../interfaces/unzipdecoder.md) + +## Index + +### Properties + +* [ondata](unzippassthrough.md#ondata) +* [compression](unzippassthrough.md#compression) + +### Methods + +* [push](unzippassthrough.md#push) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md).[ondata](../interfaces/unzipdecoder.md#ondata)* + +___ + +### compression + +▪ `Static` **compression**: number = 0 + +## Methods + +### push + +▸ **push**(`data`: Uint8Array, `final`: boolean): void + +*Implementation of [UnzipDecoder](../interfaces/unzipdecoder.md)* + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | Uint8Array | +`final` | boolean | + +**Returns:** void diff --git a/docs/classes/unzlib.md b/docs/classes/unzlib.md new file mode 100644 index 0000000..a64774b --- /dev/null +++ b/docs/classes/unzlib.md @@ -0,0 +1,62 @@ +# Class: Unzlib + +Streaming Zlib decompression + +## Hierarchy + +* **Unzlib** + +## Index + +### Constructors + +* [constructor](unzlib.md#constructor) + +### Properties + +* [ondata](unzlib.md#ondata) + +### Methods + +* [push](unzlib.md#push) + +## Constructors + +### constructor + +\+ **new Unzlib**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Unzlib](unzlib.md) + +Creates a Zlib decompression stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is inflated | + +**Returns:** [Unzlib](unzlib.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be unzlibbed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/zip.md b/docs/classes/zip.md new file mode 100644 index 0000000..a1aeee7 --- /dev/null +++ b/docs/classes/zip.md @@ -0,0 +1,86 @@ +# Class: Zip + +A zippable archive to which files can incrementally be added + +## Hierarchy + +* **Zip** + +## Index + +### Constructors + +* [constructor](zip.md#constructor) + +### Properties + +* [ondata](zip.md#ondata) + +### Methods + +* [add](zip.md#add) +* [end](zip.md#end) +* [terminate](zip.md#terminate) + +## Constructors + +### constructor + +\+ **new Zip**(`cb?`: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler)): [Zip](zip.md) + +Creates an empty ZIP archive to which files can be added + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) | The callback to call whenever data for the generated ZIP archive is available | + +**Returns:** [Zip](zip.md) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### add + +▸ **add**(`file`: [ZipInputFile](../interfaces/zipinputfile.md)): void + +Adds a file to the ZIP archive + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`file` | [ZipInputFile](../interfaces/zipinputfile.md) | The file stream to add | + +**Returns:** void + +___ + +### end + +▸ **end**(): void + +Ends the process of adding files and prepares to emit the final chunks. +This *must* be called after adding all desired files for the resulting +ZIP file to work properly. + +**Returns:** void + +___ + +### terminate + +▸ **terminate**(): void + +A method to terminate any internal workers used by the stream. Subsequent +calls to add() will fail. + +**Returns:** void diff --git a/docs/classes/zipdeflate.md b/docs/classes/zipdeflate.md new file mode 100644 index 0000000..0646989 --- /dev/null +++ b/docs/classes/zipdeflate.md @@ -0,0 +1,174 @@ +# Class: ZipDeflate + +Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate +for better performance + +## Hierarchy + +* **ZipDeflate** + +## Implements + +* [ZipInputFile](../interfaces/zipinputfile.md) + +## Index + +### Constructors + +* [constructor](zipdeflate.md#constructor) + +### Properties + +* [attrs](zipdeflate.md#attrs) +* [comment](zipdeflate.md#comment) +* [compression](zipdeflate.md#compression) +* [crc](zipdeflate.md#crc) +* [extra](zipdeflate.md#extra) +* [filename](zipdeflate.md#filename) +* [flag](zipdeflate.md#flag) +* [mtime](zipdeflate.md#mtime) +* [ondata](zipdeflate.md#ondata) +* [os](zipdeflate.md#os) +* [size](zipdeflate.md#size) + +### Methods + +* [process](zipdeflate.md#process) +* [push](zipdeflate.md#push) + +## Constructors + +### constructor + +\+ **new ZipDeflate**(`filename`: string, `opts?`: [DeflateOptions](../interfaces/deflateoptions.md)): [ZipDeflate](zipdeflate.md) + +Creates a DEFLATE stream that can be added to ZIP archives + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`filename` | string | The filename to associate with this data stream | +`opts?` | [DeflateOptions](../interfaces/deflateoptions.md) | The compression options | + +**Returns:** [ZipDeflate](zipdeflate.md) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[attrs](../interfaces/zipinputfile.md#attrs)* + +___ + +### comment + +• `Optional` **comment**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[comment](../interfaces/zipinputfile.md#comment)* + +___ + +### compression + +• **compression**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[compression](../interfaces/zipinputfile.md#compression)* + +___ + +### crc + +• **crc**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[crc](../interfaces/zipinputfile.md#crc)* + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[extra](../interfaces/zipinputfile.md#extra)* + +___ + +### filename + +• **filename**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[filename](../interfaces/zipinputfile.md#filename)* + +___ + +### flag + +• **flag**: 0 \| 1 \| 2 \| 3 + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[flag](../interfaces/zipinputfile.md#flag)* + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[mtime](../interfaces/zipinputfile.md#mtime)* + +___ + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[ondata](../interfaces/zipinputfile.md#ondata)* + +___ + +### os + +• `Optional` **os**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[os](../interfaces/zipinputfile.md#os)* + +___ + +### size + +• **size**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[size](../interfaces/zipinputfile.md#size)* + +## Methods + +### process + +▸ **process**(`chunk`: Uint8Array, `final`: boolean): void + +#### Parameters: + +Name | Type | +------ | ------ | +`chunk` | Uint8Array | +`final` | boolean | + +**Returns:** void + +___ + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be deflated + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/zippassthrough.md b/docs/classes/zippassthrough.md new file mode 100644 index 0000000..1c0d27d --- /dev/null +++ b/docs/classes/zippassthrough.md @@ -0,0 +1,149 @@ +# Class: ZipPassThrough + +A pass-through stream to keep data uncompressed in a ZIP archive. + +## Hierarchy + +* **ZipPassThrough** + +## Implements + +* [ZipInputFile](../interfaces/zipinputfile.md) + +## Index + +### Constructors + +* [constructor](zippassthrough.md#constructor) + +### Properties + +* [attrs](zippassthrough.md#attrs) +* [comment](zippassthrough.md#comment) +* [compression](zippassthrough.md#compression) +* [crc](zippassthrough.md#crc) +* [extra](zippassthrough.md#extra) +* [filename](zippassthrough.md#filename) +* [mtime](zippassthrough.md#mtime) +* [ondata](zippassthrough.md#ondata) +* [os](zippassthrough.md#os) +* [size](zippassthrough.md#size) + +### Methods + +* [push](zippassthrough.md#push) + +## Constructors + +### constructor + +\+ **new ZipPassThrough**(`filename`: string): [ZipPassThrough](zippassthrough.md) + +Creates a pass-through stream that can be added to ZIP archives + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`filename` | string | The filename to associate with this data stream | + +**Returns:** [ZipPassThrough](zippassthrough.md) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[attrs](../interfaces/zipinputfile.md#attrs)* + +___ + +### comment + +• `Optional` **comment**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[comment](../interfaces/zipinputfile.md#comment)* + +___ + +### compression + +• **compression**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[compression](../interfaces/zipinputfile.md#compression)* + +___ + +### crc + +• **crc**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[crc](../interfaces/zipinputfile.md#crc)* + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[extra](../interfaces/zipinputfile.md#extra)* + +___ + +### filename + +• **filename**: string + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[filename](../interfaces/zipinputfile.md#filename)* + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[mtime](../interfaces/zipinputfile.md#mtime)* + +___ + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[ondata](../interfaces/zipinputfile.md#ondata)* + +___ + +### os + +• `Optional` **os**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[os](../interfaces/zipinputfile.md#os)* + +___ + +### size + +• **size**: number + +*Implementation of [ZipInputFile](../interfaces/zipinputfile.md).[size](../interfaces/zipinputfile.md#size)* + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be added. If you are subclassing this with a custom +compression algorithm, note that you must push data from the source +file only, pre-compression. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/classes/zlib.md b/docs/classes/zlib.md new file mode 100644 index 0000000..33537d6 --- /dev/null +++ b/docs/classes/zlib.md @@ -0,0 +1,75 @@ +# Class: Zlib + +Streaming Zlib compression + +## Hierarchy + +* **Zlib** + +## Index + +### Constructors + +* [constructor](zlib.md#constructor) + +### Properties + +* [ondata](zlib.md#ondata) + +### Methods + +* [push](zlib.md#push) + +## Constructors + +### constructor + +\+ **new Zlib**(`opts`: [ZlibOptions](../interfaces/zliboptions.md), `cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Zlib](zlib.md) + +Creates a Zlib stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`opts` | [ZlibOptions](../interfaces/zliboptions.md) | The compression options | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Zlib](zlib.md) + +\+ **new Zlib**(`cb?`: [FlateStreamHandler](../README.md#flatestreamhandler)): [Zlib](zlib.md) + +Creates a Zlib stream + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`cb?` | [FlateStreamHandler](../README.md#flatestreamhandler) | The callback to call whenever data is deflated | + +**Returns:** [Zlib](zlib.md) + +## Properties + +### ondata + +• **ondata**: [FlateStreamHandler](../README.md#flatestreamhandler) + +The handler to call whenever data is available + +## Methods + +### push + +▸ **push**(`chunk`: Uint8Array, `final?`: boolean): void + +Pushes a chunk to be zlibbed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`chunk` | Uint8Array | The chunk to push | +`final?` | boolean | Whether this is the last chunk | + +**Returns:** void diff --git a/docs/interfaces/asyncdeflateoptions.md b/docs/interfaces/asyncdeflateoptions.md new file mode 100644 index 0000000..47af96e --- /dev/null +++ b/docs/interfaces/asyncdeflateoptions.md @@ -0,0 +1,70 @@ +# Interface: AsyncDeflateOptions + +Options for compressing data asynchronously into a DEFLATE format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + +* AsyncOptions + + ↳ **AsyncDeflateOptions** + + ↳↳ [AsyncZipOptions](asynczipoptions.md) + +## Index + +### Properties + +* [consume](asyncdeflateoptions.md#consume) +* [level](asyncdeflateoptions.md#level) +* [mem](asyncdeflateoptions.md#mem) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/docs/interfaces/asyncgunzipoptions.md b/docs/interfaces/asyncgunzipoptions.md new file mode 100644 index 0000000..0464578 --- /dev/null +++ b/docs/interfaces/asyncgunzipoptions.md @@ -0,0 +1,26 @@ +# Interface: AsyncGunzipOptions + +Options for decompressing GZIP data asynchronously + +## Hierarchy + +* AsyncOptions + + ↳ **AsyncGunzipOptions** + +## Index + +### Properties + +* [consume](asyncgunzipoptions.md#consume) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. diff --git a/docs/interfaces/asyncgzipoptions.md b/docs/interfaces/asyncgzipoptions.md new file mode 100644 index 0000000..15651eb --- /dev/null +++ b/docs/interfaces/asyncgzipoptions.md @@ -0,0 +1,92 @@ +# Interface: AsyncGzipOptions + +Options for compressing data asynchronously into a GZIP format + +## Hierarchy + +* [GzipOptions](gzipoptions.md) + +* AsyncOptions + + ↳ **AsyncGzipOptions** + +## Index + +### Properties + +* [consume](asyncgzipoptions.md#consume) +* [filename](asyncgzipoptions.md#filename) +* [level](asyncgzipoptions.md#level) +* [mem](asyncgzipoptions.md#mem) +* [mtime](asyncgzipoptions.md#mtime) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### filename + +• `Optional` **filename**: string + +*Inherited from [GzipOptions](gzipoptions.md).[filename](gzipoptions.md#filename)* + +The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file +with this name instead of the name of the compressed file. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: Date \| string \| number + +*Inherited from [GzipOptions](gzipoptions.md).[mtime](gzipoptions.md#mtime)* + +When the file was last modified. Defaults to the current time. +Set this to 0 to avoid revealing a modification date entirely. diff --git a/docs/interfaces/asyncinflateoptions.md b/docs/interfaces/asyncinflateoptions.md new file mode 100644 index 0000000..0586a5a --- /dev/null +++ b/docs/interfaces/asyncinflateoptions.md @@ -0,0 +1,39 @@ +# Interface: AsyncInflateOptions + +Options for decompressing DEFLATE data asynchronously + +## Hierarchy + +* AsyncOptions + + ↳ **AsyncInflateOptions** + + ↳↳ [AsyncUnzlibOptions](asyncunzliboptions.md) + +## Index + +### Properties + +* [consume](asyncinflateoptions.md#consume) +* [size](asyncinflateoptions.md#size) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### size + +• `Optional` **size**: number + +The original size of the data. Currently, the asynchronous API disallows +writing into a buffer you provide; the best you can do is provide the +size in bytes and be given back a new typed array. diff --git a/docs/interfaces/asyncterminable.md b/docs/interfaces/asyncterminable.md new file mode 100644 index 0000000..d79d51e --- /dev/null +++ b/docs/interfaces/asyncterminable.md @@ -0,0 +1,15 @@ +# Interface: AsyncTerminable + +A terminable compression/decompression process + +## Hierarchy + +* **AsyncTerminable** + +## Callable + +▸ (): void + +Terminates the worker thread immediately. The callback will not be called. + +**Returns:** void diff --git a/docs/interfaces/asyncunzipoptions.md b/docs/interfaces/asyncunzipoptions.md new file mode 100644 index 0000000..9e015b3 --- /dev/null +++ b/docs/interfaces/asyncunzipoptions.md @@ -0,0 +1,25 @@ +# Interface: AsyncUnzipOptions + +Options for asynchronously expanding a ZIP archive + +## Hierarchy + +* [UnzipOptions](unzipoptions.md) + + ↳ **AsyncUnzipOptions** + +## Index + +### Properties + +* [filter](asyncunzipoptions.md#filter) + +## Properties + +### filter + +• `Optional` **filter**: [UnzipFileFilter](../README.md#unzipfilefilter) + +*Inherited from [UnzipOptions](unzipoptions.md).[filter](unzipoptions.md#filter)* + +A filter function to extract only certain files from a ZIP archive diff --git a/docs/interfaces/asyncunzliboptions.md b/docs/interfaces/asyncunzliboptions.md new file mode 100644 index 0000000..053fedd --- /dev/null +++ b/docs/interfaces/asyncunzliboptions.md @@ -0,0 +1,39 @@ +# Interface: AsyncUnzlibOptions + +Options for decompressing Zlib data asynchronously + +## Hierarchy + +* [AsyncInflateOptions](asyncinflateoptions.md) + + ↳ **AsyncUnzlibOptions** + +## Index + +### Properties + +* [consume](asyncunzliboptions.md#consume) +* [size](asyncunzliboptions.md#size) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### size + +• `Optional` **size**: number + +*Inherited from [AsyncInflateOptions](asyncinflateoptions.md).[size](asyncinflateoptions.md#size)* + +The original size of the data. Currently, the asynchronous API disallows +writing into a buffer you provide; the best you can do is provide the +size in bytes and be given back a new typed array. diff --git a/docs/interfaces/asynczipoptions.md b/docs/interfaces/asynczipoptions.md new file mode 100644 index 0000000..c17a66d --- /dev/null +++ b/docs/interfaces/asynczipoptions.md @@ -0,0 +1,148 @@ +# Interface: AsyncZipOptions + +Options for asynchronously creating a ZIP archive + +## Hierarchy + +* [AsyncDeflateOptions](asyncdeflateoptions.md) + +* [ZipAttributes](zipattributes.md) + + ↳ **AsyncZipOptions** + +## Index + +### Properties + +* [attrs](asynczipoptions.md#attrs) +* [comment](asynczipoptions.md#comment) +* [consume](asynczipoptions.md#consume) +* [extra](asynczipoptions.md#extra) +* [level](asynczipoptions.md#level) +* [mem](asynczipoptions.md#mem) +* [mtime](asynczipoptions.md#mtime) +* [os](asynczipoptions.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/docs/interfaces/asynczippable.md b/docs/interfaces/asynczippable.md new file mode 100644 index 0000000..a90147d --- /dev/null +++ b/docs/interfaces/asynczippable.md @@ -0,0 +1,13 @@ +# Interface: AsyncZippable + +The complete directory structure of an asynchronously ZIPpable archive + +## Hierarchy + +* **AsyncZippable** + +## Indexable + +▪ [path: string]: [AsyncZippable](asynczippable.md) \| [AsyncZippableFile](../README.md#asynczippablefile) + +The complete directory structure of an asynchronously ZIPpable archive diff --git a/docs/interfaces/asynczliboptions.md b/docs/interfaces/asynczliboptions.md new file mode 100644 index 0000000..22f3820 --- /dev/null +++ b/docs/interfaces/asynczliboptions.md @@ -0,0 +1,68 @@ +# Interface: AsyncZlibOptions + +Options for compressing data asynchronously into a Zlib format + +## Hierarchy + +* [ZlibOptions](zliboptions.md) + +* AsyncOptions + + ↳ **AsyncZlibOptions** + +## Index + +### Properties + +* [consume](asynczliboptions.md#consume) +* [level](asynczliboptions.md#level) +* [mem](asynczliboptions.md#mem) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/docs/interfaces/deflateoptions.md b/docs/interfaces/deflateoptions.md new file mode 100644 index 0000000..74fe5d8 --- /dev/null +++ b/docs/interfaces/deflateoptions.md @@ -0,0 +1,56 @@ +# Interface: DeflateOptions + +Options for compressing data into a DEFLATE format + +## Hierarchy + +* **DeflateOptions** + + ↳ [GzipOptions](gzipoptions.md) + + ↳ [ZlibOptions](zliboptions.md) + + ↳ [AsyncDeflateOptions](asyncdeflateoptions.md) + + ↳ [ZipOptions](zipoptions.md) + +## Index + +### Properties + +* [level](deflateoptions.md#level) +* [mem](deflateoptions.md#mem) + +## Properties + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/docs/interfaces/flateerror.md b/docs/interfaces/flateerror.md new file mode 100644 index 0000000..407c707 --- /dev/null +++ b/docs/interfaces/flateerror.md @@ -0,0 +1,57 @@ +# Interface: FlateError + +An error generated within this library + +## Hierarchy + +* [Error](flateerror.md#error) + + ↳ **FlateError** + +## Index + +### Properties + +* [Error](flateerror.md#error) +* [code](flateerror.md#code) +* [message](flateerror.md#message) +* [name](flateerror.md#name) +* [stack](flateerror.md#stack) + +## Properties + +### Error + +• **Error**: ErrorConstructor + +___ + +### code + +• **code**: number + +The code associated with this error + +___ + +### message + +• **message**: string + +*Inherited from [FlateError](flateerror.md).[message](flateerror.md#message)* + +___ + +### name + +• **name**: string + +*Inherited from [FlateError](flateerror.md).[name](flateerror.md#name)* + +___ + +### stack + +• `Optional` **stack**: string + +*Inherited from [FlateError](flateerror.md).[stack](flateerror.md#stack)* diff --git a/docs/interfaces/gzipoptions.md b/docs/interfaces/gzipoptions.md new file mode 100644 index 0000000..c084efc --- /dev/null +++ b/docs/interfaces/gzipoptions.md @@ -0,0 +1,76 @@ +# Interface: GzipOptions + +Options for compressing data into a GZIP format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + + ↳ **GzipOptions** + + ↳↳ [AsyncGzipOptions](asyncgzipoptions.md) + +## Index + +### Properties + +* [filename](gzipoptions.md#filename) +* [level](gzipoptions.md#level) +* [mem](gzipoptions.md#mem) +* [mtime](gzipoptions.md#mtime) + +## Properties + +### filename + +• `Optional` **filename**: string + +The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file +with this name instead of the name of the compressed file. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: Date \| string \| number + +When the file was last modified. Defaults to the current time. +Set this to 0 to avoid revealing a modification date entirely. diff --git a/docs/interfaces/unzipdecoder.md b/docs/interfaces/unzipdecoder.md new file mode 100644 index 0000000..c1be4d1 --- /dev/null +++ b/docs/interfaces/unzipdecoder.md @@ -0,0 +1,58 @@ +# Interface: UnzipDecoder + +A decoder for files in ZIP streams + +## Hierarchy + +* **UnzipDecoder** + +## Implemented by + +* [AsyncUnzipInflate](../classes/asyncunzipinflate.md) +* [UnzipInflate](../classes/unzipinflate.md) +* [UnzipPassThrough](../classes/unzippassthrough.md) + +## Index + +### Properties + +* [ondata](unzipdecoder.md#ondata) +* [terminate](unzipdecoder.md#terminate) + +### Methods + +* [push](unzipdecoder.md#push) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• `Optional` **terminate**: [AsyncTerminable](asyncterminable.md) + +A method to terminate any internal workers used by the stream. Subsequent +calls to push() should silently fail. + +## Methods + +### push + +▸ **push**(`data`: Uint8Array, `final`: boolean): void + +Pushes a chunk to be decompressed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data in this chunk. Do not consume (detach) this data. | +`final` | boolean | Whether this is the last chunk in the data stream | + +**Returns:** void diff --git a/docs/interfaces/unzipdecoderconstructor.md b/docs/interfaces/unzipdecoderconstructor.md new file mode 100644 index 0000000..88388c7 --- /dev/null +++ b/docs/interfaces/unzipdecoderconstructor.md @@ -0,0 +1,45 @@ +# Interface: UnzipDecoderConstructor + +A constructor for a decoder for unzip streams + +## Hierarchy + +* **UnzipDecoderConstructor** + +## Index + +### Constructors + +* [constructor](unzipdecoderconstructor.md#constructor) + +### Properties + +* [compression](unzipdecoderconstructor.md#compression) + +## Constructors + +### constructor + +\+ **new UnzipDecoderConstructor**(`filename`: string, `size?`: number, `originalSize?`: number): [UnzipDecoder](unzipdecoder.md) + +Creates an instance of the decoder + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`filename` | string | The name of the file | +`size?` | number | The compressed size of the file | +`originalSize?` | number | The original size of the file | + +**Returns:** [UnzipDecoder](unzipdecoder.md) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA diff --git a/docs/interfaces/unzipfile.md b/docs/interfaces/unzipfile.md new file mode 100644 index 0000000..41990bc --- /dev/null +++ b/docs/interfaces/unzipfile.md @@ -0,0 +1,88 @@ +# Interface: UnzipFile + +Streaming file extraction from ZIP archives + +## Hierarchy + +* **UnzipFile** + +## Index + +### Properties + +* [compression](unzipfile.md#compression) +* [name](unzipfile.md#name) +* [ondata](unzipfile.md#ondata) +* [originalSize](unzipfile.md#originalsize) +* [size](unzipfile.md#size) +* [terminate](unzipfile.md#terminate) + +### Methods + +* [start](unzipfile.md#start) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA. If start() is called but there is no +decompression stream available for this method, start() will throw. + +___ + +### name + +• **name**: string + +The name of the file + +___ + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### originalSize + +• `Optional` **originalSize**: number + +The original size of the file. Will not be present for archives created +in a streaming fashion. + +___ + +### size + +• `Optional` **size**: number + +The compressed size of the file. Will not be present for archives created +in a streaming fashion. + +___ + +### terminate + +• **terminate**: [AsyncTerminable](asyncterminable.md) + +A method to terminate any internal workers used by the stream. ondata +will not be called any further. + +## Methods + +### start + +▸ **start**(): void + +Starts reading from the stream. Calling this function will always enable +this stream, but ocassionally the stream will be enabled even without +this being called. + +**Returns:** void diff --git a/docs/interfaces/unzipfileinfo.md b/docs/interfaces/unzipfileinfo.md new file mode 100644 index 0000000..d1d8853 --- /dev/null +++ b/docs/interfaces/unzipfileinfo.md @@ -0,0 +1,51 @@ +# Interface: UnzipFileInfo + +Information about a file to be extracted from a ZIP archive + +## Hierarchy + +* **UnzipFileInfo** + +## Index + +### Properties + +* [compression](unzipfileinfo.md#compression) +* [name](unzipfileinfo.md#name) +* [originalSize](unzipfileinfo.md#originalsize) +* [size](unzipfileinfo.md#size) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA. If the filter function returns true +but this value is not 8, the unzip function will throw. + +___ + +### name + +• **name**: string + +The name of the file + +___ + +### originalSize + +• **originalSize**: number + +The original size of the file + +___ + +### size + +• **size**: number + +The compressed size of the file diff --git a/docs/interfaces/unzipoptions.md b/docs/interfaces/unzipoptions.md new file mode 100644 index 0000000..2b5e98b --- /dev/null +++ b/docs/interfaces/unzipoptions.md @@ -0,0 +1,23 @@ +# Interface: UnzipOptions + +Options for expanding a ZIP archive + +## Hierarchy + +* **UnzipOptions** + + ↳ [AsyncUnzipOptions](asyncunzipoptions.md) + +## Index + +### Properties + +* [filter](unzipoptions.md#filter) + +## Properties + +### filter + +• `Optional` **filter**: [UnzipFileFilter](../README.md#unzipfilefilter) + +A filter function to extract only certain files from a ZIP archive diff --git a/docs/interfaces/unzipped.md b/docs/interfaces/unzipped.md new file mode 100644 index 0000000..349bd9e --- /dev/null +++ b/docs/interfaces/unzipped.md @@ -0,0 +1,15 @@ +# Interface: Unzipped + +An unzipped archive. The full path of each file is used as the key, +and the file is the value + +## Hierarchy + +* **Unzipped** + +## Indexable + +▪ [path: string]: Uint8Array + +An unzipped archive. The full path of each file is used as the key, +and the file is the value diff --git a/docs/interfaces/zipattributes.md b/docs/interfaces/zipattributes.md new file mode 100644 index 0000000..adf55bc --- /dev/null +++ b/docs/interfaces/zipattributes.md @@ -0,0 +1,88 @@ +# Interface: ZipAttributes + +Attributes for files added to a ZIP archive object + +## Hierarchy + +* **ZipAttributes** + + ↳ [ZipOptions](zipoptions.md) + + ↳ [AsyncZipOptions](asynczipoptions.md) + + ↳ [ZipInputFile](zipinputfile.md) + +## Index + +### Properties + +* [attrs](zipattributes.md#attrs) +* [comment](zipattributes.md#comment) +* [extra](zipattributes.md#extra) +* [mtime](zipattributes.md#mtime) +* [os](zipattributes.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/docs/interfaces/zipinputfile.md b/docs/interfaces/zipinputfile.md new file mode 100644 index 0000000..44bf3a9 --- /dev/null +++ b/docs/interfaces/zipinputfile.md @@ -0,0 +1,194 @@ +# Interface: ZipInputFile + +A stream that can be used to create a file in a ZIP archive + +## Hierarchy + +* [ZipAttributes](zipattributes.md) + + ↳ **ZipInputFile** + +## Implemented by + +* [AsyncZipDeflate](../classes/asynczipdeflate.md) +* [ZipDeflate](../classes/zipdeflate.md) +* [ZipPassThrough](../classes/zippassthrough.md) + +## Index + +### Properties + +* [attrs](zipinputfile.md#attrs) +* [comment](zipinputfile.md#comment) +* [compression](zipinputfile.md#compression) +* [crc](zipinputfile.md#crc) +* [extra](zipinputfile.md#extra) +* [filename](zipinputfile.md#filename) +* [flag](zipinputfile.md#flag) +* [mtime](zipinputfile.md#mtime) +* [ondata](zipinputfile.md#ondata) +* [os](zipinputfile.md#os) +* [size](zipinputfile.md#size) +* [terminate](zipinputfile.md#terminate) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA + +___ + +### crc + +• **crc**: number + +A CRC of the original file contents. This attribute may be invalid after +the file is added to the ZIP archive; it must be correct only before the +stream completes. + +If you don't want to have to generate this yourself, consider extending the +ZipPassThrough class and overriding its process() method, or using one of +ZipDeflate or AsyncZipDeflate. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### filename + +• **filename**: string + +The filename to associate with the data provided to this stream. If you +want a file in a subdirectory, use forward slashes as a separator (e.g. +`directory/filename.ext`). This will still work on Windows. + +___ + +### flag + +• `Optional` **flag**: number + +Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's +APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely +to be necessary. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### ondata + +• `Optional` **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to be called when data is added. After passing this stream to +the ZIP file object, this handler will always be defined. To call it: + +`stream.ondata(error, chunk, final)` + +error = any error that occurred (null if there was no error) + +chunk = a Uint8Array of the data that was added (null if there was an +error) + +final = boolean, whether this is the final chunk in the stream + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. + +___ + +### size + +• **size**: number + +The size of the file in bytes. This attribute may be invalid after +the file is added to the ZIP archive; it must be correct only before the +stream completes. + +If you don't want to have to compute this yourself, consider extending the +ZipPassThrough class and overriding its process() method, or using one of +ZipDeflate or AsyncZipDeflate. + +___ + +### terminate + +• `Optional` **terminate**: [AsyncTerminable](asyncterminable.md) + +A method called when the stream is no longer needed, for clean-up +purposes. This will not always be called after the stream completes, +so you may wish to call this.terminate() after the final chunk is +processed if you have clean-up logic. diff --git a/docs/interfaces/zipoptions.md b/docs/interfaces/zipoptions.md new file mode 100644 index 0000000..4f7aceb --- /dev/null +++ b/docs/interfaces/zipoptions.md @@ -0,0 +1,136 @@ +# Interface: ZipOptions + +Options for creating a ZIP archive + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + +* [ZipAttributes](zipattributes.md) + + ↳ **ZipOptions** + +## Index + +### Properties + +* [attrs](zipoptions.md#attrs) +* [comment](zipoptions.md#comment) +* [extra](zipoptions.md#extra) +* [level](zipoptions.md#level) +* [mem](zipoptions.md#mem) +* [mtime](zipoptions.md#mtime) +* [os](zipoptions.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/docs/interfaces/zippable.md b/docs/interfaces/zippable.md new file mode 100644 index 0000000..feecac1 --- /dev/null +++ b/docs/interfaces/zippable.md @@ -0,0 +1,13 @@ +# Interface: Zippable + +The complete directory structure of a ZIPpable archive + +## Hierarchy + +* **Zippable** + +## Indexable + +▪ [path: string]: [Zippable](zippable.md) \| [ZippableFile](../README.md#zippablefile) + +The complete directory structure of a ZIPpable archive diff --git a/docs/interfaces/zliboptions.md b/docs/interfaces/zliboptions.md new file mode 100644 index 0000000..338b1a0 --- /dev/null +++ b/docs/interfaces/zliboptions.md @@ -0,0 +1,56 @@ +# Interface: ZlibOptions + +Options for compressing data into a Zlib format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + + ↳ **ZlibOptions** + + ↳↳ [AsyncZlibOptions](asynczliboptions.md) + +## Index + +### Properties + +* [level](zliboptions.md#level) +* [mem](zliboptions.md#mem) + +## Properties + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. |