npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fidian/rumkin-compression

v1.1.2

Published

Compression routines for the rumkin.com website.

Downloads

30

Readme

Rumkin Compression

These are the ciphers that are used to power the pages involving compression at rumkin.com.

Build Status Dependencies Dev Dependencies codecov.io

Available Libraries

  • huffman - A Huffman encoder for Buffer objects.
  • huffmanAscii - Huffman encoding of strings. Results are in Base64.
  • lz77 - Implementation of LZ77 for Buffer objects.
  • lz77 - LZ77 that uses a custom Base91 encoding.

How to Use

Every library exports the same interface. It can be called synchronously or asynchronously.

// First, pick your library.
var library = require("@fidian/rumkin-compression").lz77;

// Synchronous compression and decompression.
resultBuffer = library.compressSync(inputBuffer);
decompressedBuffer = library.decompressSync(resultBuffer);

// Promised compression and decompression.
library.compressAsync(inputBuffer).then((resultBuffer) => {
    return library.decompressAsync(resultBuffer);
}).then((decompressedBuffer) => { ... });

// Asynchronous/callback based compression.
// Callback definition: callback(err, resultBuffer)
// Progress definition: progress(progressDataObject)
// Call the cancel function to abort compression/decompression
cancelFn = library.compress(inputBuffer, callbackFn, [progressFn]);
cancelFn = library.decompress(inputBuffer, callbackFn, [progressFn]);

// Managing the async/sync stuff yourself.
compressor = library.compressDirect(inputBuffer);
decompressor = library.decompressDirect(inputBuffer);

// Tiny sync version of a decompressor for a browser.
// For ASCII flavors, this takes the encoded string. For the Buffer
// variants, this takes a Buffer or any array-like thing where the values
// are the character codes (eg. input[0] == 97). They always return a
// string.
result = library.decompressTiny(inputBufferOrTypedArray);

Making Tiny Tinier

The tiny, synchronous functions of decompressors available for use in web pages. They are self-contained functions, so you could call .toString() on the functions to minify them.

// Minifying a tiny decompressor by using `.toString()` on the exported
// function. This isn't very fun and you could just minify the file
// itself instead.
uglifyJs = require("uglifyjs");
tinyDecompress = uglifyJs({
    lz77DecompressTiny: compression.lz77.decompressTiny.toString(),
}, {
    fromString: true,
    ... other options ...
});

Alternately, you can minify from the command line.

uglifyjs node-modules/@fidian/rumkin-compression/lib/lz77/decompress-tiny.js --screw-ie8 -m -c

Installation

Use npm to install this package easily.

$ npm install --save @fidian/rumkin-compression

Alternately you may edit your package.json and add this to your dependencies object:

{
    ...
    "dependencies": {
        ...
        "@fidian/rumkin-compression": "*"
        ...
    }
    ...
}

License

This software is licensed under a MIT license that contains additional non-advertising and patent-related clauses. Read full license terms