Skip to content

StarCommons:easy_deflate

Ivica Ceraj edited this page Jan 14, 2014 · 3 revisions

StarCommons/easy_deflate is AMD module that makes it easy to inflate & deflate text. Common usage is to convert state to JSON and than deflate it as to save amount of data saved.

Usage in JavaScript is:

require( ['StarCommons/easy_deflate'], function(ed) {
var compressed = compress.deflate( text );
var decompressed = compress.inflate( compressed ) ;
assert( decompressed == text );
});

Usage in TypeScript is:

/// <reference path="../StarCommons/easy_deflate.d.ts" />
import compress = require("StarCommons/easy_deflate");
var compressed = compress.deflate( text );
var decompressed = compress.inflate( compressed ) ;
assert( decompressed == text );
Clone this wiki locally