• Version 4.0.6
  • Published
  • 5.97 kB
  • 2 dependencies
  • MIT license


npm i @types/koa-compress
yarn add @types/koa-compress
pnpm add @types/koa-compress


TypeScript definitions for koa-compress



function koaCompress

koaCompress: (options?: koaCompress.CompressOptions) => Koa.Middleware;
  • Compress middleware for Koa


interface CompressOptions

interface CompressOptions {}

    property br

    br?: zlib.BrotliOptions | false | undefined;
    • Options for brotli compression.

    property defaultEncoding

    defaultEncoding?: string | undefined;
    • An optional string, which specifies what encoders to use for requests without Accept-Encoding. Default: 'idenity'.

    property deflate

    deflate?: zlib.ZlibOptions | false | undefined;
    • Options for deflate compression.

    property filter

    filter?: ((mimeType: string) => boolean) | undefined;
    • An optional function that checks the response content type to decide whether to compress. By default, it uses compressible.

    property gzip

    gzip?: zlib.ZlibOptions | false | undefined;
    • Options for gzip compression.

    property threshold

    threshold?: number | string | undefined;
    • Minimum response size in bytes to compress. Default 1024 bytes or 1kb.

    Package Files (1)

    Dependencies (2)

    Dev Dependencies (0)

    No dev dependencies.

    Peer Dependencies (0)

    No peer dependencies.


    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/koa-compress.

    • Markdown
    • HTML
      <a href="https://www.jsdocs.io/package/@types/koa-compress"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>