Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@jprochazk/cbor
Advanced tools
JavaScript implementation of the CBOR RFC 7049.
This library is meant for use in the browser, but will also work in Node.
> npm install @jprochazk/cbor
The API is very simple:
import CBOR from "@jprochazk/cbor";
const json = {
"key": "value",
"another key": [
1, 2, 3
],
"number": 3.141592653589793
"nulls are also encoded": null
};
// ArrayBuffer(51)
const encoded = CBOR.encode(json);
// { "key": "value", "another key": [1, 2, 3], "number": 3.14159265359, "nulls are also encoded": null}
const decoded = CBOR.decode(encoded);
console.log(decoded.key); // value
console.log(decoded.number); // 3.1415927410125732
You can also encode into a pre-allocated ArrayBuffer.
// Allocate a 64 byte buffer
const buffer = new ArrayBuffer(64);
// Encode the data into this buffer
const encoded = CBOR.encodeInto(data, buffer);
There are a few things from the specification which are currently unimplemented:
These weren't required in my case, but if you need one or more of these features, submit an issue, and I'll implement it! :)
FAQs
Partial implementation of RFC 7049 (CBOR)
The npm package @jprochazk/cbor receives a total of 86 weekly downloads. As such, @jprochazk/cbor popularity was classified as not popular.
We found that @jprochazk/cbor 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.