
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
json-shrink
Advanced tools
shrink objects/json with LZMA (7-zip) or Brotli compression + optional jsonpack
var shrunken = shrink(obj, outputAsString = false, doPack = true, doUseBrotli = false);
var unshrunk = unshrink(shrunken, doUnPack = true, doUseBrotli = false);
npm i json-shrink
var jsh = require('json-shrink');
var shrink = jsh.shrink;
var unshrink = jsh.unshrink;
//compressing json into buffer or string:
//shrink(obj, outputAsString = false, doPack = true, doUseBrotli=false)
var original_obj = {ok:"here is some text"};
var compressed_into_buffer = shrink(original_obj); //output as buffer
var compressed_into_string = shrink(original_obj, true); // output as base64 string
//uncompressing
//note - params used for uncompressing must align with the params used for compressing!
//unshrink(shrunken, doUnPack = true, doUseBrotli=false);
console.log("uncompressed str", unshrink(compressed_into_string));
console.log("uncompressed buffer", unshrink(compressed_into_buffer));
//result
//uncompressed str { ok: 'here is some text' }
//uncompressed buffer { ok: 'here is some text' }
//with jsonpack disabled:
var compressed_buffer_nopack = shrink(original_obj, false, false);
var compressed_string_nopack = shrink(original_obj, true, false);
console.log("uncompressed str - no jsonpack", unshrink(compressed_string_nopack, false));
console.log("uncompressed buffer - no jsonpack", unshrink(compressed_buffer_nopack, false));
//result
//uncompressed str - no jsonpack { ok: 'here is some text' }
//uncompressed buffer - no jsonpack { ok: 'here is some text' }
json-shrinkFAQs
shrink json objects with LZMA (7-zip) or Brotli compression + jsonpack
The npm package json-shrink receives a total of 447 weekly downloads. As such, json-shrink popularity was classified as not popular.
We found that json-shrink demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.