Skip to content

decompressAsync

decompressAsync(data, maxOutputSize?): Promise<Buffer<ArrayBufferLike>>

Defined in: index.d.ts:1369

Asynchronously decompress data by auto-detecting the compression format.

Detects the format like detectFormat and decompresses using the appropriate algorithm. Returns a Promise that resolves to the decompressed data as a Buffer.

maxOutputSize limits the decompressed size in bytes, as for decompress. It defaults to 256 MB.

Supported formats: zstd, gzip, brotli, lz4. Raw deflate is not supported (no magic bytes to distinguish it). Data detected as brotli that does not decode as brotli rejects with the same error as data of unknown format, since brotli detection is heuristic.

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

number | null

Promise<Buffer<ArrayBufferLike>>