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 🙏

© 2025 – Pkg Stats / Ryan Hefner

js-lzma

v0.1.0

Published

js-lzma is a port of the LZMA decompression algorithm to JavaScript

Readme

js-lzma is a port of the LZMA decompression algorithm to JavaScript.

The source code is a manual translation from the original Java version found in the LZMA SDK.

Usage

If you have the content of a .lzma file then just call to the decompressFile function:

LZMA.decompressFile(inStream, outStream);

Where:

  • inStream is the input data stream to decompress
  • outStream is the output data stream

If you want more control about the process then you can use the decompress function:

LZMA.decompress(properties, inStream, outStream, outSize);

Where:

  • properties is the input data stream with LZMA properties
  • inStream is the input data stream to decompress
  • outStream is the output data stream
  • outSize is the expected size of output data stream

Streams

Input data streams must be JavaScript objects exposing a public readByte function:

var inStream = {
  data: [ /* Put your compressed data here */ ],
  offset: 0,
  readByte: function(){
    return this.data[this.offset ++];
  }
};

Output data streams must be JavaScript objects exposing a public writeByte function:

var outStream = {
  data: [ /* Uncompressed data will be putted here */ ],
  offset: 0,
  writeByte: function(value){
    this.data[this.offset ++] = value;
  }
};

Ok, you can mix both on a more generic one. And change Array to String, some sort of Typed Array, or whatever you want.

Properties

LZMA properties are described in the LZMA SDK.

Just five bytes. The first one containing lc, lp and pb parameters, and the last four the dictionary size (little endian encoding).

Limitations

Output size is limited to 32 bits.

What about compression function?

Sorry, don't. This library is part of another project of mine that only needed the decompression algorithm.