npm install jsonsquasher --save
NodeJS
const jsonsquasher = require('jsonsquasher');
Browser
<script src='node_modules/jsonsquasher/build/jsonsquasher.js' type='text/javascript'></script>
...or use ES6 import
// 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);