@coderbuzz/msgpack
v0.2.0
Published
High-performance MessagePack serialization for TypeScript - encode, decode, and zero-copy variants.
Maintainers
Readme
Msgpack — @coderbuzz/msgpack
MessagePack for TypeScript that is safe on untrusted input. ~35% smaller than JSON for compact objects, byte-compatible with @msgpack/msgpack, no dependencies. Bun, Node.js and Deno.
Why @coderbuzz/msgpack?
- Safe decoding — bounds-checked reads, no allocation beyond the input size, nesting and length limits, one
MsgpackDecodeErrorfor every malformed input - No silent failures — unsupported values throw
MsgpackEncodeErrorwith their path __proto__stays data — likeJSON.parse- Compatible — float32, ext and Timestamp from any encoder; unknown ext types round-trip
- Fast paths — reusable buffer, inline and in-place UTF-8, decoder key cache
- Options —
new Encoder()/new Decoder(): timestamps, sorted keys, int64,Map, zero-copy bin, limits, extensions
Installation
npm install @coderbuzz/msgpackQuick Start
import { decode, encode } from "@coderbuzz/msgpack";
const bytes = encode({ name: "Alice", age: 30, active: true });
// 25 bytes vs 39 bytes JSON
const value = decode(bytes);
// => { name: "Alice", age: 30, active: true }Documentation
Full API reference, options, error codes and wire format details: DOCS.md
License
MIT © 2026 Indra Gunawan
