• Stars
    star
    103
  • Rank 331,493 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

lzwCompress.js

npm CircleCI Appveyor Travis Coverage Status codecov FOSSA Status

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

Usage:

Install lzwCompress from npm:

npm install lzwcompress

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

import lzwCompress from 'lzwcompress';

const json = {
  name: 'Mr. JavaScript Kumar',
  age: 42,
  start_date: new Date(),
  address: {
    street: '123 MG Road',
    city: 'Mumbai',
    state: 'Maharashtra',
    country: 'India'
  }
};

// to compress objects
const compressed = lzwCompress.pack(json);

// to uncomress
const original = lzwCompress.unpack(compressed);

console.log(original);

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.

License

MIT License

FOSSA Status

Other Libraries

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