
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 serialization and deserialization library that space-efficiently packs data into buffers.
This module is now browser compatible, due to this the following changes have been made:
npm i bufferfy
import { Codec } from 'bufferfy';
export const ExampleCodec = Codec.Object({
id: Codec.String("hex", 32),
relatedIds: Codec.Array(Codec.String("hex", 32)),
createdAt: Codec.VarInt(),
updatedAt: Codec.VarInt(),
deletedAt: Codec.Optional(Codec.VarInt()),
});
type ExampleData = CodecType<typeof ExampleCodec>;
const example: ExampleData = {
// ... values
}
const buffer = ExampleCodec.encode(example)
const data = ExampleCodec.decode(buffer) // returns ExampleData
// Streams
const encoder = ExampleCodec.Encoder(); // Takes values and outputs buffer chunks
encoder.pipe(stream);
encoder.write(value);
encoder.end();
const decoder = ExampleCodec.Decoder(); // Takes buffer chunks and outputs values
decoder.on("data", (data) => {
// ... logic
});
stream.pipe(decoder);
All codecs provide a standard set of methods.
buffer = AnyCodec.encode(data, target?, offset?)Returns the data serialized into a buffer. A buffer and offset can be provided, otherwise a new buffer will be created.
data = AnyCodec.decode(buffer, start?, end?)Returns the unserialized data from a buffer.
number = AnyCodec.byteLength(data)Returns the byte length of the data if it were serialized.
boolean = AnyCodec.isValid(data)Returns true if the codec is able to serialize and unserialize provided data.
Type = CodecType<typeof codec>Returns the value type of the provided codec.
Codec.Union() tests codecs sequentially. First match wins.
Order specific → general. Put Codec.Any() last (matches everything).
// Correct
Codec.Union([Codec.Constant("active"), Codec.String(), Codec.Any()])
// Wrong - Any() shadows everything
Codec.Union([Codec.Any(), Codec.String()])
Values used for benchmarks can be found here.
bufferfy.size 50
msgpack.size 149
JSON.size 221
bufferfy.size 1050
msgpack.size 1706
JSON.size 1775
FAQs
Fast and efficient buffer serialization.
The npm package bufferfy receives a total of 18 weekly downloads. As such, bufferfy popularity was classified as not popular.
We found that bufferfy demonstrated a healthy version release cadence and project activity because the last version was released less than 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.