Skip to main content
Module

x/http_compress/deps.ts>brotli

Compress HTTP response, supported Web standard compression methods
Latest
function brotli
import { brotli } from "https://deno.land/x/http_compress@1.0.1/deps.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: number = [UNSUPPORTED]

Read buffer size

optional
quality: number = [UNSUPPORTED]

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

optional
lgwin: number = [UNSUPPORTED]

Base 2 logarithm of the sliding window size.

Returns

Uint8Array