Ƭ AsyncFlateStreamHandler: (err: FlateError | null,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: Uint8Array | AsyncZippable | []
A file that can be used to asynchronously create a ZIP archive
Ƭ FlateCallback: (err: FlateError | null,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: (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: (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: (err: FlateError | null,data: Unzipped) => void
Callback for asynchronous ZIP decompression
param Any error that occurred
param The decompressed ZIP archive
Ƭ UnzipFileFilter: (file: UnzipFileInfo) => 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: (file: UnzipFile) => void
Handler for streaming ZIP decompression
param The file that was found in the archive
Ƭ ZippableFile: Uint8Array | Zippable | []
A file that can be used to create a ZIP archive
• 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
| 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 | 
▸ decompress(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable
Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
opts | 
AsyncInflateOptions | The decompression options | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ decompress(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchrononously expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ decompressSync(data: Uint8Array, out?: Uint8Array): Uint8Array
Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
| 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(data: Uint8Array, opts: AsyncDeflateOptions, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with DEFLATE without any wrapper
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts | 
AsyncDeflateOptions | The compression options | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ deflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with DEFLATE without any wrapper
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ deflateSync(data: Uint8Array, opts?: DeflateOptions): Uint8Array
Compresses data with DEFLATE without any wrapper
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts? | 
DeflateOptions | The compression options | 
Returns: Uint8Array
▸ gunzip(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable
Asynchronously expands single-member GZIP data
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
opts | 
AsyncGunzipOptions | The decompression options | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ gunzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously expands single-member GZIP data
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ gunzipSync(data: Uint8Array, out?: Uint8Array): Uint8Array
Expands single-member GZIP data
| 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(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with GZIP
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts | 
AsyncGzipOptions | The compression options | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with GZIP
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ gzip(data: Uint8Array, opts: AsyncGzipOptions, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with GZIP
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts | 
AsyncGzipOptions | The compression options | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ gzip(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with GZIP
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ gzipSync(data: Uint8Array, opts?: GzipOptions): Uint8Array
Compresses data with GZIP
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts? | 
GzipOptions | The compression options | 
Returns: Uint8Array
▸ inflate(data: Uint8Array, opts: AsyncInflateOptions, cb: FlateCallback): AsyncTerminable
Asynchronously expands DEFLATE data with no wrapper
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
opts | 
AsyncInflateOptions | The decompression options | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ inflate(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously expands DEFLATE data with no wrapper
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ inflateSync(data: Uint8Array, out?: Uint8Array): Uint8Array
Expands DEFLATE data with no wrapper
| 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(dat: Uint8Array, latin1?: boolean): string
Converts a Uint8Array to a string
| 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(str: string, latin1?: boolean): Uint8Array
Converts a string into a Uint8Array for use with compression/decompression methods
| 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(data: Uint8Array, opts: AsyncUnzipOptions, cb: UnzipCallback): AsyncTerminable
Asynchronously decompresses a ZIP archive
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The raw compressed ZIP file | 
opts | 
AsyncUnzipOptions | The ZIP extraction options | 
cb | 
UnzipCallback | The callback to call with the decompressed files | 
Returns: AsyncTerminable
▸ unzip(data: Uint8Array, cb: UnzipCallback): AsyncTerminable
Asynchronously decompresses a ZIP archive
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The raw compressed ZIP file | 
cb | 
UnzipCallback | The callback to call with the decompressed files | 
Returns: AsyncTerminable
▸ unzipSync(data: Uint8Array, opts?: UnzipOptions): Unzipped
Synchronously decompresses a ZIP archive. Prefer using unzip for better
performance with more than one file.
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The raw compressed ZIP file | 
opts? | 
UnzipOptions | The ZIP extraction options | 
Returns: Unzipped
▸ unzlib(data: Uint8Array, opts: AsyncGunzipOptions, cb: FlateCallback): AsyncTerminable
Asynchronously expands Zlib data
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
opts | 
AsyncGunzipOptions | The decompression options | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ unzlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously expands Zlib data
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to decompress | 
cb | 
FlateCallback | The function to be called upon decompression completion | 
Returns: AsyncTerminable
▸ unzlibSync(data: Uint8Array, out?: Uint8Array): Uint8Array
Expands Zlib data
| 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(data: AsyncZippable, opts: AsyncZipOptions, cb: FlateCallback): AsyncTerminable
Asynchronously creates a ZIP file
| Name | Type | Description | 
|---|---|---|
data | 
AsyncZippable | The directory structure for the ZIP archive | 
opts | 
AsyncZipOptions | The main options, merged with per-file options | 
cb | 
FlateCallback | The callback to call with the generated ZIP archive | 
Returns: AsyncTerminable
▸ zip(data: AsyncZippable, cb: FlateCallback): AsyncTerminable
Asynchronously creates a ZIP file
| Name | Type | Description | 
|---|---|---|
data | 
AsyncZippable | The directory structure for the ZIP archive | 
cb | 
FlateCallback | The callback to call with the generated ZIP archive | 
Returns: AsyncTerminable
▸ zipSync(data: Zippable, opts?: ZipOptions): Uint8Array
Synchronously creates a ZIP file. Prefer using zip for better performance
with more than one file.
| Name | Type | Description | 
|---|---|---|
data | 
Zippable | The directory structure for the ZIP archive | 
opts? | 
ZipOptions | The main options, merged with per-file options | 
Returns: Uint8Array
▸ zlib(data: Uint8Array, opts: AsyncZlibOptions, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with Zlib
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts | 
AsyncZlibOptions | The compression options | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ zlib(data: Uint8Array, cb: FlateCallback): AsyncTerminable
Asynchronously compresses data with Zlib
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
cb | 
FlateCallback | The function to be called upon compression completion | 
Returns: AsyncTerminable
▸ zlibSync(data: Uint8Array, opts?: ZlibOptions): Uint8Array
Compress data with Zlib
| Name | Type | Description | 
|---|---|---|
data | 
Uint8Array | The data to compress | 
opts? | 
ZlibOptions | The compression options | 
Returns: Uint8Array