Socket
Socket
Sign inDemoInstall

tiny-inflate

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tiny-inflate

A tiny inflate implementation


Version published
Weekly downloads
1.9M
decreased by-18.23%
Maintainers
1
Install size
42.8 kB
Created
Weekly downloads
 

Package description

What is tiny-inflate?

The tiny-inflate npm package is a minimal JavaScript implementation of the inflate algorithm, which is used for decompressing data compressed with the DEFLATE compression algorithm. It is designed to be small and efficient, suitable for use in environments where resources are limited or where only the inflate functionality is needed without the overhead of a full zlib implementation.

What are tiny-inflate's main functionalities?

Decompressing a DEFLATE-compressed buffer

This feature allows you to decompress a buffer of data that has been compressed using the DEFLATE algorithm. You need to provide the compressed data as a Uint8Array and an output buffer with the expected size of the decompressed data. After calling tinyInflate with these parameters, the output buffer will contain the decompressed data.

var tinyInflate = require('tiny-inflate');
var compressed = new Uint8Array([...]); // Your compressed data here
var output = new Uint8Array(outputSize); // Output buffer with a size you expect the decompressed data to be

tinyInflate(compressed, output);
// Now 'output' contains the decompressed data

Other packages similar to tiny-inflate

Readme

Source

tiny-inflate

This is a port of Joergen Ibsen's tiny inflate to JavaScript. Minified it is about 3KB, or 1.3KB gzipped. While being very small, it is also reasonably fast (about 30% - 50% slower than pako on average), and should be good enough for many applications. If you need the absolute best performance, however, you'll need to use a larger library such as pako that contains additional optimizations.

Installation

npm install tiny-inflate

Example

To use tiny-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);

License

MIT

Keywords

FAQs

Last updated on 17 Nov 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc