Skip to main content
Module

x/http_compress/mod.ts>withCompress

Compress HTTP response, supported Web standard compression methods
Latest
function withCompress
import { withCompress } from "https://deno.land/x/http_compress@1.0.1/mod.ts";

Takes a handler and returns a handler with the response body compressed.

import { withCompress } from "https://deno.land/x/http_compress@$VERSION/mod.ts";

function handler(req: Request): Response {
  return new Response("Huge content");
}
Deno.serve(withCompress(handler));

Parameters

handler: Handler
optional
options: CompressOptions = [UNSUPPORTED]