Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lume/deps/brotli.ts>compress

🔥 Static site generator for Deno 🦕
Very Popular
Latest
function compress
import { compress } from "https://deno.land/x/lume@v2.4.1/deps/brotli.ts";

Compress a byte array.

import { compress } from "https://deno.land/x/brotli/mod.ts";
const text = new TextEncoder().encode("X".repeat(64));
console.log(text.length);                   // 64 Bytes
console.log(compress(text).length);         // 10 Bytes

Parameters

input: Uint8Array

Input data.

optional
bufferSize = [UNSUPPORTED]

Read buffer size

optional
quality = [UNSUPPORTED]

Controls the compression-speed vs compression- density tradeoff. The higher the quality, the slower the compression.

optional
lgwin = [UNSUPPORTED]

Base 2 logarithm of the sliding window size.

Returns

Uint8Array