mini_inflate
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Mini Inflate

logo

npm size-badge dependency-count-badge Types

About the Project

This is an update and port to typescript of Devon Govett port of Joergen Ibsen's tiny inflate. Minified it is about 3KB and after brotli it barely break 1 kb. It's also dependency free!

Install

Package Manager

NPM

npm i mini_inflate

PNPM

pnpm add mini_inflate

Yarn

yarn add mini_inflate

CDN

Skypack

For Web and Deno, no install is required! Just put this line at the top of your file:

import { inflate } from 'https://cdn.skypack.dev/mini_inflate';

If you want type support with skypack, follow the directions here

UNPKG

<script src="https://unpkg.com/mini_inflate"></script>

And use it like you would any other package from UNPKG

Usage

Here's the great part: thanks to microbundle, this package supports CJS, UMD, and ESM formats. That means that wherever and however you use this package — in browser or node, with import or require — you should be set, no configuration required.

Example

To use mini_inflate, you need two things: a buffer of data compressed with deflate, and the decompressed size (often stored in a file header) to allocate your output buffer. Input and output buffers can be either node Buffers, or Uint8Arrays.

var inflate = require('tiny-inflate');

var compressedBuffer = new Bufer([ ... ]);
var decompressedSize = ...;
var outputBuffer = new Buffer(decompressedSize);

inflate(compressedBuffer, outputBuffer);

Similar Tools

If this tool isn't working for you, try one of these:

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Find me @Brian-Crotty on github or @illumincrotty on twitter

Readme

Keywords

Package Sidebar

Install

npm i mini_inflate

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

96.9 kB

Total Files

13

Last publish

Collaborators

  • illumincrotty