Skip to content

gzipCompressWithHeader

gzipCompressWithHeader(data, header, level?): Buffer

Defined in: index.d.ts:1481

Compress data using gzip with custom header metadata.

Allows setting header fields such as filename and mtime. Throws if filename contains a NUL character or is longer than 65535 bytes in UTF-8. Returns the compressed data as a Buffer. Level is an integer from 0 (no compression) to 9 (best compression). Default is 6.

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

GzipHeaderOptions

number | null

Buffer