Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gusb3ll/elysia-compression

Compression plugin for elysia
https://github.com/gusb3ll/elysia-compression

bun compression elysia

Last synced: 3 months ago
JSON representation

Compression plugin for elysia

Awesome Lists containing this project

README

        

# elysia-compression

Compression plugin for [elysia](https://github.com/elysiajs/elysia)

## Installation

```bash
bun add elysia-compression
```

## Example

```typescript
import { Elysia } from 'elysia'
import { compression } from 'elysia-compression'

const app = new Elysia().use(compression()).listen(8080)
```

## Config

### type

@default `gzip`

The type of compression to use. Can be one of the following:

- `gzip`
- `deflate`

### options

@default `{}`

Options passed to the compression library.

Refer to the bun zlib options [documentation](https://bun.sh/docs/api/utils#bun-gzipsync) for more details.

### encoding

@default `utf-8`

The encoding of the response body that is being compressed.