Skip to content

zstdDecompressWithDictWithCapacityAsync

zstdDecompressWithDictWithCapacityAsync(data, dict, capacity): Promise<Buffer<ArrayBufferLike>>

Defined in: index.d.ts:1809

Asynchronously decompress Zstandard-compressed data that was compressed with a dictionary, with explicit capacity.

Use this when the decompressed size exceeds the default 256 MB limit. The capacity parameter specifies the maximum decompressed size in bytes. It is only a limit: the output buffer grows with the decompressed data, so a large capacity reserves no memory up front. capacity also bounds the window that a frame makes the decoder allocate before it writes any output: to capacity rounded up to a power of two, at least 8 MiB and at most zstd’s default of 128 MiB, so for a frame that declares a larger window the promise rejects with an error instead. The same dictionary used for compression must be provided.

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

number

Promise<Buffer<ArrayBufferLike>>