Compression plugin for Hono
bun add bun-compression
import { Hono } from 'hono'
import { compress } from 'bun-compression'
const app = new Hono()
app.use('*', compress())
@default gzip
The type of compression to use. Can be one of the following:
gzip
deflate
@default {}
Options passed to the compression library.
Refer to the bun zlib options documentation for more details.
@default utf-8
The encoding of the response body that is being compressed.
This project is inspired by elysia-compression by gusb3ll. Adaptations have been made to support Hono.