- AsyncDecompress
- AsyncDeflate
- AsyncGunzip
- AsyncGzip
- AsyncInflate
- AsyncUnzipInflate
- AsyncUnzlib
- AsyncZipDeflate
- AsyncZlib
- DecodeUTF8
- Decompress
- Deflate
- EncodeUTF8
- Gunzip
- Gzip
- Inflate
- Unzip
- UnzipInflate
- UnzipPassThrough
- Unzlib
- Zip
- ZipDeflate
- ZipPassThrough
- Zlib
- AsyncDeflateOptions
- AsyncGunzipOptions
- AsyncGzipOptions
- AsyncInflateOptions
- AsyncTerminable
- AsyncUnzipOptions
- AsyncUnzlibOptions
- AsyncZipOptions
- AsyncZippable
- AsyncZlibOptions
- DeflateOptions
- FlateError
- GunzipOptions
- GunzipStreamOptions
- GzipOptions
- InflateOptions
- InflateStreamOptions
- UnzipDecoder
- UnzipDecoderConstructor
- UnzipFile
- UnzipFileInfo
- UnzipOptions
- Unzipped
- UnzlibOptions
- UnzlibStreamOptions
- ZipAttributes
- ZipInputFile
- ZipOptions
- Zippable
- ZlibOptions
- AsyncFlateDrainHandler
- AsyncFlateStreamHandler
- AsyncZippableFile
- FlateCallback
- FlateStreamHandler
- GunzipMemberHandler
- StringStreamHandler
- UnzipCallback
- UnzipFileFilter
- UnzipFileHandler
- ZippableFile
- decompress
- decompressSync
- deflate
- deflateSync
- gunzip
- gunzipSync
- gzip
- gzipSync
- inflate
- inflateSync
- strFromU8
- strToU8
- unzip
- unzipSync
- unzlib
- unzlibSync
- zip
- zipSync
- zlib
- zlibSync
Renames and re-exports AsyncGzip
Renames and re-exports Gzip
Renames and re-exports gzip
Renames and re-exports gzipSync
Ƭ AsyncFlateDrainHandler: (size
: number
) => void
▸ (size
): void
Handler for the asynchronous completion of (de)compression for a data chunk
Name | Type | Description |
---|---|---|
size |
number |
The number of bytes that were processed. This is measured in terms of the input (i.e. compressed bytes for decompression, uncompressed bytes for compression.) |
void
Ƭ AsyncFlateStreamHandler: (err
: FlateError
| null
, data
: Uint8Array
, final
: boolean
) => void
▸ (err
, data
, final
): void
Handler for asynchronous data (de)compression streams
Name | Type | Description |
---|---|---|
err |
FlateError | null |
Any error that occurred |
data |
Uint8Array |
The data output from the stream processor |
final |
boolean |
Whether this is the final block |
void
Ƭ AsyncZippableFile: Uint8Array
| AsyncZippable
| [Uint8Array
| AsyncZippable
, AsyncZipOptions
]
A file that can be used to asynchronously create a ZIP archive
Ƭ FlateCallback: (err
: FlateError
| null
, data
: Uint8Array
) => void
▸ (err
, data
): void
Callback for asynchronous (de)compression methods
Name | Type | Description |
---|---|---|
err |
FlateError | null |
Any error that occurred |
data |
Uint8Array |
The resulting data. Only present if err is null |
void
Ƭ FlateStreamHandler: (data
: Uint8Array
, final
: boolean
) => void
▸ (data
, final
): void
Handler for data (de)compression streams
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data output from the stream processor |
final |
boolean |
Whether this is the final block |
void
Ƭ GunzipMemberHandler: (offset
: number
) => void
▸ (offset
): void
Handler for new GZIP members in concatenated GZIP streams. Useful for building indices used to perform random-access reads on compressed files.
Name | Type | Description |
---|---|---|
offset |
number |
The offset of the new member relative to the start of the stream |
void
Ƭ StringStreamHandler: (data
: string
, final
: boolean
) => void
▸ (data
, final
): void
Handler for string generation streams
Name | Type | Description |
---|---|---|
data |
string |
The string output from the stream processor |
final |
boolean |
Whether this is the final block |
void
Ƭ UnzipCallback: (err
: FlateError
| null
, data
: Unzipped
) => void
▸ (err
, data
): void
Callback for asynchronous ZIP decompression
Name | Type | Description |
---|---|---|
err |
FlateError | null |
Any error that occurred |
data |
Unzipped |
The decompressed ZIP archive |
void
Ƭ UnzipFileFilter: (file
: UnzipFileInfo
) => boolean
▸ (file
): boolean
A filter for files to be extracted during the unzipping process
Name | Type | Description |
---|---|---|
file |
UnzipFileInfo |
The info for the current file being processed |
boolean
Whether or not to extract the current file
Ƭ UnzipFileHandler: (file
: UnzipFile
) => void
▸ (file
): void
Handler for streaming ZIP decompression
Name | Type | Description |
---|---|---|
file |
UnzipFile |
The file that was found in the archive |
void
Ƭ ZippableFile: Uint8Array
| Zippable
| [Uint8Array
| Zippable
, ZipOptions
]
A file that can be used to create a ZIP archive
• Const
FlateErrorCode: Object
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
, opts
, cb
): 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 |
A function that can be used to immediately terminate the decompression
▸ decompress(data
, cb
): 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 |
A function that can be used to immediately terminate the decompression
▸ decompressSync(data
, opts?
): Uint8Array
Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
opts? |
InflateOptions |
The decompression options |
Uint8Array
The decompressed version of the data
▸ deflate(data
, opts
, cb
): 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 |
A function that can be used to immediately terminate the compression
▸ deflate(data
, cb
): 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 |
▸ deflateSync(data
, opts?
): Uint8Array
Compresses data with DEFLATE without any wrapper
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to compress |
opts? |
DeflateOptions |
The compression options |
Uint8Array
The deflated version of the data
▸ gunzip(data
, opts
, cb
): AsyncTerminable
Asynchronously expands 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 |
A function that can be used to immediately terminate the decompression
▸ gunzip(data
, cb
): AsyncTerminable
Asynchronously expands GZIP data
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
cb |
FlateCallback |
The function to be called upon decompression completion |
A function that can be used to immediately terminate the decompression
▸ gunzipSync(data
, opts?
): Uint8Array
Expands GZIP data
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
opts? |
GunzipOptions |
The decompression options |
Uint8Array
The decompressed version of the data
▸ gzip(data
, opts
, cb
): 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 |
A function that can be used to immediately terminate the compression
▸ gzip(data
, cb
): 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 |
A function that can be used to immediately terminate the decompression
▸ gzipSync(data
, opts?
): Uint8Array
Compresses data with GZIP
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to compress |
opts? |
GzipOptions |
The compression options |
Uint8Array
The gzipped version of the data
▸ inflate(data
, opts
, cb
): 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 |
A function that can be used to immediately terminate the decompression
▸ inflate(data
, cb
): 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 |
A function that can be used to immediately terminate the decompression
▸ inflateSync(data
, opts?
): Uint8Array
Expands DEFLATE data with no wrapper
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
opts? |
InflateOptions |
The decompression options |
Uint8Array
The decompressed version of the data
▸ strFromU8(dat
, latin1?
): 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. |
string
The original UTF-8/Latin-1 string
▸ strToU8(str
, latin1?
): 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. |
Uint8Array
The string encoded in UTF-8/Latin-1 binary
▸ unzip(data
, opts
, cb
): 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 |
A function that can be used to immediately terminate the unzipping
▸ unzip(data
, cb
): 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 |
A function that can be used to immediately terminate the unzipping
▸ unzipSync(data
, opts?
): 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 |
The decompressed files
▸ unzlib(data
, opts
, cb
): AsyncTerminable
Asynchronously expands Zlib data
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
opts |
AsyncUnzlibOptions |
The decompression options |
cb |
FlateCallback |
The function to be called upon decompression completion |
A function that can be used to immediately terminate the decompression
▸ unzlib(data
, cb
): AsyncTerminable
Asynchronously expands Zlib data
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
cb |
FlateCallback |
The function to be called upon decompression completion |
A function that can be used to immediately terminate the decompression
▸ unzlibSync(data
, opts?
): Uint8Array
Expands Zlib data
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to decompress |
opts? |
UnzlibOptions |
The decompression options |
Uint8Array
The decompressed version of the data
▸ zip(data
, opts
, cb
): 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 |
A function that can be used to immediately terminate the compression
▸ zip(data
, cb
): 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 |
A function that can be used to immediately terminate the compression
▸ zipSync(data
, opts?
): 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 |
Uint8Array
The generated ZIP archive
▸ zlib(data
, opts
, cb
): 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 |
▸ zlib(data
, cb
): 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 |
A function that can be used to immediately terminate the compression
▸ zlibSync(data
, opts?
): Uint8Array
Compress data with Zlib
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to compress |
opts? |
ZlibOptions |
The compression options |
Uint8Array
The zlib-compressed version of the data