Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

inflation

2.0.0 • Public • Published

inflation

NPM version Build Status Coverage Status

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'].

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)
  })
})

install

npm i inflation

Downloadsweekly downloads

146,876

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability