0.3.2 • Published 8 years ago

json-lzw v0.3.2

Weekly downloads
29
License
GPL
Repository
github
Last release
8 years ago

JSON-LZW

This is a compression algorithm for json data (use jsonpack and lzw).

In my tests the json message is reduced by almost 80%.

Install

npm install json-lzw

Example

"use strict";

var lzw = require("json-lzw");
var buffer = "{ 'message': 'hello world' }";

var encode = lzw.encode(buffer);
console.log(encode);

var decode = lzw.decode(buffer);
console.log(decode);

API

encode(value)

encoding json string and return string encoded

decode(value)

decoding string value and return json string

AngularJS integration

Under json-lzw-install-path/angular there is jsonlzw.js, port of this library for AngularJS. Follow example of use.

In your html file put

<script src="path/jsonlzw.js" type="text/javascript"></script>

In your angular controller file put

var app = angular.module('app', ['jsonlzw']);

app.controller('myController', function($scope, jsonlzw) {
	...
	var encode = jsonlzw.encode(...);
	...
	var decode = jsonlzw.decode(...);
	...
}

Contributors

Thanks

  • Rodrigo for jsonpack module
  • Gustavo for angular patch
0.3.2

8 years ago

0.3.1

8 years ago

0.2.2

8 years ago

0.2.1

9 years ago

0.1.20

9 years ago

0.1.12

9 years ago

0.1.10

9 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago