1.0.5 • Published 7 years ago

@rill/compress v1.0.5

Weekly downloads
15
License
MIT
Repository
github
Last release
7 years ago

Isomorphic response body compression middleware for Rill using gzip or deflate if available.

Installation

npm install @rill/compress

Example

const app = require('rill')()
const compress = require('@rill/compress')

app.use(compress())
app.use(({ req, res }, next)=> {
	// Send this file.
	// Supported encodings: gzip, deflate and identity.
	res.body = fs.createReadStream(__filename)
})

API Options / Defaults.

{
	// The minimum response size to compress.
	threshold: "1kb",
	// Optional function to filter compressed responses by content-type.
	filter: function (contentType) { ... }
}

Contributions

  • Use gulp to run tests.

Please feel free to create a PR!

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago