
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
A lightweight package designed for storing JSON data in a compressed and serialized format.
compresjon is a lightweight package designed for storing JSON data in a compressed and serialized format.
It is particularly useful for:
CompreSJON uses
msgpackin combination with Brotli compression to ensure low memory utilization or bandwidth usage.
npm install compresjon
Converts a JavaScript Object Notation (JSON) into its compressed counterpart.
import CompreSJON from 'compresjon';
const json = new CompreSJON({ hello: 'world' });
/**
* CompreSJON can create an instance from a `Buffer` created by
* another instance. Eg. if your API sends back a `Buffer` over
* its API request, the client can create a `CompreSJON` from that `Buffer`.
*/
const json = new CompreSJON<{ hello: 'world' }>(buffer);
Override the internal compressed data with a new updated dataset.
const json = new CompreSJON({ hello: 'world' });
json.update({ hello: 'universe' });
console.log(CompreSJON.parse(json)); // { hello: 'universe' }
You can stringify a CompreSJON instance using the static stringify method:
const json = new CompreSJON({ hello: 'world' });
console.log(CompreSJON.stringify(json)); // '{"hello":"world"}'
You can convert a CompreSJON instance back to JSON using the static parse method:
const json = new CompreSJON({ hello: 'world' });
console.log(CompreSJON.parse(json)); // { hello: 'world' }
Keep in mind that when using parse that there will be two instances of the JSON data in memory during the runtime. Both the internal binary representation and the parsed JSON. So depending on your use case you can look into dump:
const json = new CompreSJON({ hello: 'world' });
console.log(CompreSJON.dump(json)); // { hello: 'world' }
console.log(json.buffer.length); // 0
Dumping the data will return the parsed JSON while also clearing the internal binary reference. This means that the only instance available, during the runtime after dump, is the parsed JSON. Just don't forget to update with the updated data once it's ready to be compressed again.
CompreSJONalso has a built-intoJSON()method allowing it to be sent back through an API directly to the client, exposing the internalBuffer.
FAQs
A lightweight package designed for storing JSON data in a compressed and serialized format.
The npm package compresjon receives a total of 2 weekly downloads. As such, compresjon popularity was classified as not popular.
We found that compresjon 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.