Ende.deflateSync

function

function Ende.deflateSync(data: AllowSharedBufferSource, options?: { format?: ZlibFormat; level?: number }): Uint8Array<ArrayBuffer>

Compresses data into one stream, synchronously.

const input = new TextEncoder().encode("hello hello hello");
const gzipped = Ende.deflateSync(input, { format: "gzip", level: 9 });
const { data } = new Ende.Inflater({ format: "gzip" }).push(gzipped);
console.log(new TextDecoder().decode(data)); // "hello hello hello"
data: AllowSharedBufferSource
options?: { format?: ZlibFormat; level?: number }