vapr-decompress

0.5.2 • Public • Published

vapr-decompress Build Status

Installation

npm install --save vapr
npm install --save vapr-decompress

Usage

This plugin decompresses the request body based on the Content-Encoding and Transfer-Encoding headers.

const decompress = require('vapr-decompress');
const app = require('vapr')();
const route = app.get('/foo');
 
route.use(decompress());
route.use((req) => {
  const decompressed = req.read();
});

Options

The transferOnly option can be used to leave Content-Encodings intact (i.e., the request body will only be decoded based on the Transfer-Encoding header).

route.use(decompress({ transferOnly: true }));

Any other options passed to the plugin are forwarded to the zlib core module.

Package Sidebar

Install

npm i vapr-decompress

Weekly Downloads

4

Version

0.5.2

License

MIT

Unpacked Size

5.92 kB

Total Files

6

Last publish

Collaborators

  • joshuawise