/jsonsquasher

Lightweight and efficient JSON compressor

Primary LanguageJavaScriptMIT LicenseMIT

Install

npm install jsonsquasher --save

Include

NodeJS

const jsonsquasher = require('jsonsquasher');

Browser

<script src='node_modules/jsonsquasher/build/jsonsquasher.js' type='text/javascript'></script>

...or use ES6 import

Use

// Compression
const compressedJson = jsonsquasher.compress(json);
// Decompression
const decompressedJson = jsonsquasher.decompress(compressedJson);
// Faster and less memory usage, but with JSON mutation
console.log(json);
jsonsquasher.compress(json,{mutateJSON:true});
jsonsquasher.decompress(json,{mutateJSON:true});
console.log(json);