Skip to main content
Module

x/http_compression/mod.ts>compression

🗜️ Deno HTTP compression middleware
Latest
variable compression
import { compression } from "https://deno.land/x/http_compression@0.3.3/mod.ts";

HTTP Compression middleware.

Examples

Example 1

import { compression } from 'https://deno.land/x/http_compression/mod.ts'
import { Server } from 'https://deno.land/std@0.181.0/http/server.ts'

new Server({
  handler: async (req) => {
    return await compression({ path, compression: ['br', 'gzip', 'deflate'] })(req)
  }, port: 3000
}).listenAndServe()

type

(opts: CompressionOptions) => unknown