{"library":"koa-compress","type":"library","category":null,"description":"`koa-compress` is a middleware for Koa.js applications that provides HTTP response compression. It is actively maintained, with the current stable version being 5.2.1, and demonstrates a consistent release cadence through regular patch and minor updates, such as `v5.2.0`, `v5.1.1`, and `v5.0.1`. The library automatically negotiates and applies various compression algorithms including `gzip`, `deflate`, `brotli` (br), and `zstandard` (zstd), adapting to client capabilities and server configuration. Key differentiators include its deep integration with the Koa context, allowing for granular control over compression via `ctx.compress` and `ctx.compress` as an options object. It offers flexible configuration for `filter` predicates, `threshold` for minimum compressible size, and algorithm-specific settings. Furthermore, it supports functional properties to dynamically adjust compression parameters based on response type, size, and the full Koa context, aiming to optimize network transfer sizes by offloading content encoding from application logic.","language":"javascript","status":"active","version":"5.2.1","tags":["javascript","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install koa-compress","imports":["import compress from 'koa-compress';","const compress = require('koa-compress');","import type { CompressOptions } from 'koa-compress';","import { constants as zlibConstants } from 'zlib';"]},{"cmd":"yarn add koa-compress","imports":[]},{"cmd":"pnpm add koa-compress","imports":[]}],"homepage":null,"github":"https://github.com/koajs/compress","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/koa-compress","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/koa-compress/compatibility"}}