inflate-raw
decompress a raw DEFLATE buffer or stream in node and the browser
Last updated 2 years ago by goto-bus-stop .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install inflate-raw 
SYNC missed versions from official npm registry.

inflate-raw

decompress a raw DEFLATE buffer or stream in node and the browser

It uses a subset of pako in the browser which is smaller than using the zlib-browserify module.

Install - Usage - License: Apache-2.0

npm travis standard

Install

npm install inflate-raw

Usage

var inflateRaw = require('inflate-raw')
inflateRaw(compressedBuffer, function (err, uncompressedBuffer) {
})

var inflateRawStream = require('inflate-raw/stream')
someCompressedStream
  .pipe(inflateRawStream())
  .pipe(elsewhere)

var inflateRawWorker = require('inflate-raw/worker')
inflateRawWorker(compressedBuffer, function (err, uncompressedBuffer) {
})

In the browser, the main inflate-raw entry point is blocking, so if you inflate a very large buffer the browser may hang. You can use inflate-raw/worker instead which has the same API, but offloads the inflating to a Web Worker. Note that you cannot use compressedBuffer while inflation is in progress, because it is moved into the worker rather than copied. If you need to use the compressedBuffer, manually copy it first. After inflation, the compressedBuffer is moved back to the main thread, so you can use it again.

The inflate-raw/stream API is also synchronous but if the data comes streaming in in small chunks it will not noticeably lag the browser. It exposes a node-style stream transform interface.

License

Apache-2.0

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |