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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@graphistry/node-pigz

v2.0.2

Published

Multicore gzip/libz compression via a pig wrapper

Downloads

20

Readme

=== node-pigz by Graphistry, Inc. ===

What is it?

Node-pigz wraps pigz for multicore compression. Pigz "is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data." It is a great way to reduce latency, or, for the same latency, increase compression.

Node-pigz supports both JavaScript's ArrayBuffers (typed arrays) and Node's Buffer. The default wrapper takes Uint8Arrays and returns Buffers.

The Latest Version

See github repo

Installation

node-pigz depends on pigz and node-gyp. It assumes pigz is at "/usr/local/bin/pigz".

  1. brew install pigz
  2. npm install -g node-gyp
  3. npm install

Licensing

See file LICENSE

Contacts

See github repo

Example

var compress = require('./compress.js');

var inputArr = [];
for (var i = 0; i < 1024 * 1024; i++) {
    inputArr.push(i % 20);
}

var inputTypedArr = new Uint32Array(inputArr);
var t0 = new Date().getTime();
compress.deflate(new Uint8Array(inputTypedArr.buffer), function (err, outputBuffer) {
    if (err) {
        return console.error('Compression error', err);
    } else {
        console.log(
            'deflated:', (inputTypedArr.byteLength/(1024*1024)).toFixed(2), 'MB', 
            '-->', (outputBuffer.length/(1024*1024)), 'MB');
        console.log('(', (100 * outputBuffer.length/inputTypedArr.byteLength).toFixed(2), '%)');
        console.log(new Date().getTime() - t0, 'ms');
    }
});


// Output:
// deflated: 4.00 MB --> 0.027303695678710938 MB
// ( 0.68 %)
// 28 'ms'