README.md 3.1 KB

fflate

Index

Interfaces

Functions

Functions

decompress

decompress(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?: DeflateOptions): Uint8Array

Compresses data with DEFLATE without any wrapper

Parameters:

Name Type Description
data Uint8Array The data to compress
opts? DeflateOptions The compression options

Returns: Uint8Array


gunzip

gunzip(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?: GZIPOptions): Uint8Array

Compresses data with GZIP

Parameters:

Name Type Description
data Uint8Array The data to compress
opts? GZIPOptions The compression options

Returns: Uint8Array


inflate

inflate(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


unzlib

unzlib(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


zlib

zlib(data: Uint8Array, opts?: ZlibOptions): Uint8Array

Compress data with Zlib

Parameters:

Name Type Description
data Uint8Array The data to compress
opts? ZlibOptions The compression options

Returns: Uint8Array