/inflate

Naive and slow implementation of inflate decompression

Primary LanguageJavaScript

@indutny/inflate

npm

This is an education project, please don't use it in production

Very naive and unoptimized implementation of Inflate part of the DEFLATE spec.

Installation

npm install @indutny/inflate

Usage

import Inflate from '@indutny/inflate';

const blocks = [];

const inflate = new Inflate({
  onBlock(block) {
    blocks.push(Buffer.from(block));
  },
});

for (const byte of buffer) {
  inflate.push(byte);
}
inflate.finish();

console.log(Buffer.concat(blocks));

LICENSE

This software is licensed under the MIT License.