{"repo":"expressjs/compression","free":true,"listed":false,"github":"https://github.com/expressjs/compression","clone":"git clone https://github.com/expressjs/compression.git","description":"Node.js compression middleware","language":"JavaScript","stars":2805,"topics":["compression","javascript","nodejs","expressjs","middleware","gzip","deflate"],"license":"MIT","category":"dev-tools","readme_excerpt":"compression [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url] [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] [![Funding][funding-image]][funding-url] Node.js compression middleware. The following compression codings are supported: - deflate - gzip - br (brotli) Note Brotli is supported only since Node.js versions v11.7.0 and v10.16.0. Install This is a Node.js module available through the npm registry. Installation is done using the npm install command: API compression([options]) Returns the compression middleware using the given options . The middleware will attempt to compress response bodies for all requests that traverse through the middleware, based on the given options . This middleware will never compress responses that include a Cache-Control header with the no-transform directive, as compressing will transform the body. Options compression() accepts these properties in the options object. In addition to those listed below, zlib options may be passed in to the options object or brotli options. chunkSize Type: Number Default: zlib.constants.Z DEFAULT CHUNK , or 16384 . See Node.js documentation regarding the usage. filter Type: Function A function to decide if the response should be considered for compression. This function is called as filter(req, res) and is expected to return true to consider the response for compression, or false to","default_branch":null,"files":null,"tree":[],"storefront":"/r/expressjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/expressjs/compression/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}