npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

http-gzip-maybe

1.0.0

@yoshuawuyts

npmHomeRepoSnykSocket
Downloads:65
$ npm install http-gzip-maybe
DailyWeeklyMonthlyYearly

http-gzip-maybe stability

npm version build status downloads js-standard-style

Compress an HTTP response if the client has headers that allow it

Usage

var gzipMaybe = require('http-gzip-maybe')
var http = require('http')
var pump = require('pump')

http.createServer(function (req, res) {
  var gzip = gzipMaybe(req, res)
  pump(req, gzip, res)
}).listen(8080)

API

stream = gzipMaybe(req, res)

Create a transform stream that conditionally compresses the outgoing data.

License

MIT