Socket
Book a DemoInstallSign in
Socket

inflate-until

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inflate-until

take buffer chunks until the inflated result is === size

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

inflate-until

a module for that really odd case where you know how big the thing you're deflating is, but you want to deflate it and know how big the compressed data was.

NB: this is slow.


var stream = inflateUntil(256)

inflateUntil.write(buf, function(info) {
  if(info) {

  }
})

API

inflateUntil(size) -> inflate

create an inflateUntil function.

inflate(buf, ready) -> undefined

add another buf to the available bytes. calls ready when finished -- if there was enough data to determine whether or not we've reached size + the adler checksum, ready will receive an info argument:

{ compressed: Number    // size of compressed bytes written
, rest: Buffer          // Buffer representing unused bytes
, data: Buffer }        // uncompressed data

License

MIT

Keywords

inflate

FAQs

Package last updated on 02 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts