Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

inflation

stream-utils3.3mMIT2.1.0TypeScript support: definitely-typed

Easily unzip an HTTP stream

decompress, unzip, inflate, zlib, gunzip, brotli

readme

inflation

NPM version CI

Automatically unzip an HTTP stream.

API

var inflate = require('inflation')

inflate(stream, options)

Returns a stream that emits inflated data from the given stream.

Options:

  • encoding - The encoding of the stream (gzip or deflate). If not given, will look in stream.headers['content-encoding'].
  • brotli - BrotliOptions to use for Brotli decompression

Example

var inflate = require('inflation')
var raw     = require('raw-body')

http.createServer(function (req, res) {
  raw(inflate(req), 'utf-8', function (err, string) {
    console.dir(string)
  })
})

Contributors


dougwilson


bminer


fengmk2

This project follows the git-contributor spec, auto updated at Sat Oct 14 2023 12:55:08 GMT+0800.

changelog

2.1.0 / 2023-10-14

  • Add Brotli support for Node v10.16.0 and newer

2.0.0 / 2016-04-09

  • Add identity support #14
  • Remove node v0.8 support

1.0.2 / 2014-06-13

  • Fix specifying encoding in options

1.0.1 / 2014-04-24

  • Add 415 status code to unsupported content encodings

1.0.0 / 2014-04-24

  • Initial release