Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/gusb3ll/elysia-compression
- Owner: Gusb3ll
- License: mit
- Created: 2023-07-07T23:03:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-26T04:33:37.000Z (12 months ago)
- Last Synced: 2024-07-29T12:38:37.155Z (3 months ago)
- Topics: bun, compression, elysia
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/elysia-compression
- Size: 128 KB
- Stars: 19
- Watchers: 2
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-elysia - compression - Compression plugin. (Plugins)
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.