node package manager

lzwcompress

Lossless LZW compression/decompression implemented in JavaScript for strings/JSON/JS objects.

lzwCompress.js

Lossless LZW compression/decompression implemented in JavaScript for strings/JSON/JS objects.

Install lzwCompress from npm:

npm install lzwcompress

And then to use it in your node.js applications:

var lzwCompress = require('lzwcompress');
 
...
 
// To compress anything from within JS 
var compressed = lzwCompress.pack(humongousObj);
 
...
 
// And to decompress it 
var original = lzwCompress.unpack(compressed);

Install lzwCompress from npm:

bower install --save lzwcompress

Then include lzwCompress.js using a script tag in your HTML:

<script src="lzwCompress.js"></script>

And then use it in your browser applications:

var lzwCompress = window.lzwCompress;
 
...
 
// To compress anything from within JS 
var compressed = lzwCompress.pack(humongousObj);
 
...
 
// And to decompress it 
var original = lzwCompress.unpack(compressed);

Applies LZW compression and JSON key optimization and makes JSON (or any javascript object) smaller for local storage, to ship up to the server etc.

MIT License

For use in Angular 1.X projects, check out the angular-lzwcompress module