Releases: DevsDaddy/flash-buffer
Public Release (1.1.6)
Hotfix update
This version is improvement for string conversion. Use it if you have a troubles with TextEncoder and shared buffers.
What's new?
- Added new
ConvertUtilsclass; - Replaced
TextEncoderandTextDecodersanywhere;
Public Release (1.1.5)
Meet the new version of Flash Buffer — even more convenient for serializing your data than ever before. New serialization types, dynamic object handling, improved schemas, and extensibility.
What's new?
- Added new
booleantype for flash buffer and schema; - Added dynamic serializer for objects of any type (methods:
readDynamicandwriteDynamic); - Added dynamic support for
FlashBufferSchema;
Dynamic Serializer Example:
// Create custom class
class Person {
constructor(public name: string, public age: number) {}
}
// Register custom class
registerClass(Person, {
write(buf, p: Person) {
buf.writeString(p.name, "utf-8", true);
buf.writeUint8(p.age);
},
read(buf) {
const name = buf.readString();
const age = buf.readUint8();
return new Person(name, age);
}
});
// Create a dynamic object
interface IOriginal {
id: number;
name: string;
isActive: boolean;
createdAt: Date;
tags: string[];
profile: Person;
metadata: Map<string, string>;
data: Uint8Array;
}
// Deserialized object
const original : IOriginal = {
id: 123,
name: 'Alice',
isActive: true,
createdAt: new Date(),
tags: ['admin', 'user'],
profile: new Person('Alice', 30),
metadata: new Map([['key', 'value']]),
data: new Uint8Array([1, 2, 3]),
};
// Serialize and deserialize dynamically
buf.writeDynamic(original);
buf.reset();
const restored = buf.readDynamic<IOriginal>();
console.log(restored);
// restored equals to originalPublic Release (1.1.4)
New util methods for FlashBuffer presented in this version.
What's new?
- Changed method
toUint8Array(addedcopyargument); - Added new static method
fromUint8Arrayfor conversion; - Added new test for this methods;
Usage example for new methods:
let serialized = FlashBufferSchema.serialize(player).toUint8Array();
let deserialized = FlashBufferSchema.deserialize(Player, FlashBuffer.fromUint8Array(serialized));Public Release (1.1.3)
More stability with new fallback support in browsers for automatic mode.
PR: #7
What's new?
- Added fallback for
SharedArrayBuffer. This fallback uses ifSharedArrayBufferblocked in browser or not supported.
Public Release (1.1.2)
This is a bug-fix update for client-side (browser) applications based on this PR.
Please, use this release for stable full-stack applications.
What's new?
- Hotfix: Replaced TextEncoder to native for browsers.
Public Release (1.1.1)
Working with the library has become even more convenient thanks to more precise typing. Even more stability for your applications.
What's new:
- Added branded types:
Uint8,Int8,Uint16LE,Uint16BE,Int16LE,Int16BE,Uint32LE,Uint32BE,Int32LE,Int32BE,Float32LE,Float32BE,Float64LE,Float64BE,BigUint64LE,BigUint64BE,BigInt64LE,BigInt64BE,VarUint32,VarInt32,VarUint64 - Added methods:
writeandreadtoFlashBufferfor branded types;
Public Release (1.1.0)
Welcome to new Flash Buffer release. In this version: extended serialization, protobuf support, binary diff / patch and new utils.
What's new in v.1.1.0 (13.04.2026)?
New Features:
- Added binary diff / path: methods
diff(newBuffer),applyPatch(patchBuffer); - Added new basic types: (Sint32, Sint64, VarUint64, Fixed32, Fixed64, SFixed32, SFixed64);
- Protobuf support: Added protobuf reader / writer based on Flash Buffer;
- Added new buffer utils:
truncate(),toUint8Array(),copyFrom(data, offset);
Updates:
- Added new types for FlashBuffer Schema;
- Added new tests for features;
- Update README with new examples;
Public Release (1.0.0)
A lightning-fast, zero-copy binary data manipulation library for TypeScript.
⚡ FlashBuffer provides a powerful and convenient API for reading from and writing to ArrayBuffer and SharedArrayBuffer. It eliminates manual offset tracking, automatically manages buffer growth, and is designed for maximum performance by avoiding unnecessary memory copying wherever possible.
The library includes a suite of advanced tools: from bit-level operations and VarInt encoding to declarative object serialization.
🚀 Flash Buffer Features
- Zero-Copy Operations: Reading bytes returns a direct
Uint8Arrayview into the underlying buffer, not a copy.
Smart Memory Management:
- Automatic Offset Tracking: The internal cursor advances automatically on reads and writes.
- Dynamic Buffer Growth: Buffers expand automatically when needed. Choose from
exact,powerOfTwo, orfixedgrowth strategies. - Efficient Buffer Pool (FlashBufferPool): Reuses buffers of similar sizes to reduce GC pressure.
- Resizable ArrayBuffer: Leverages the native
ArrayBuffer.prototype.resize()for high-performance memory management.
Cross-Platform:
SharedArrayBufferSupport: Enables safe and efficient zero-copy data sharing between threads (Web Workers, Node.js Worker Threads).- Works Everywhere: Runs seamlessly in modern browsers, Node.js, Deno, and Bun.
Advanced Data Formats:
- VarInt (LEB128) with ZigZag Encoding: Efficient storage for variable-length integers, commonly used in Protocol Buffers.
- Bit-Level Operations (BitBuffer): Read and write arbitrary numbers of bits (1-32) for flags, compressed data, and cryptography.
- C-Strings (Null-Terminated Strings): Convenient handling of strings found in system APIs and network protocols.
- Streaming I/O: Adapters for seamless integration with Web Streams API (
FlashReadableStream/FlashWritableStream).
Schema-Based Serialization (experimental):
- Declarative Schemas: Define binary structures using TypeScript decorators (@field).
- Automatic (De)Serialization: The Schema class serializes and deserializes objects to and from binary buffers, eliminating manual errors.