npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@coderbuzz/msgpack

v0.1.3

Published

High-performance MessagePack serialization for TypeScript - encode, decode, and zero-copy variants.

Readme

Msgpack — @coderbuzz/msgpack

High-performance MessagePack serialization for TypeScript.

Encodes and decodes JSON-compatible values to compact binary representation, optimized for minimal allocations and fast throughput.

Highlights

  • Full MessagePack spec support: nil, bool, int, float, string, binary, array, map
  • Reusable encoder buffer to minimize GC pressure
  • Fast ASCII string path for short strings (common JSON keys)
  • Compile-time branching for smallest integer representation
  • Manual UTF-8 encoding for short strings, TextEncoder fallback for long ones
  • encodeUnsafe zero-copy path for immediate consumption (e.g. writing to a socket)
  • encodeInto for writing into a pre-allocated buffer
  • encodedSize for pre-calculating byte length without allocating

Installation

# npm
npm install @coderbuzz/msgpack

# Bun
bun add @coderbuzz/msgpack

# Deno
import { encode, decode } from "npm:@coderbuzz/msgpack";

Usage

Encode & Decode

import { decode, encode } from "@coderbuzz/msgpack";

const bytes = encode({ name: "Alice", age: 30, active: true });
// => Uint8Array (compact binary)

const value = decode(bytes);
// => { name: 'Alice', age: 30, active: true }

Zero-Copy Encode

import { encodeUnsafe } from "@coderbuzz/msgpack";

// Returns a view into the internal buffer — NOT a copy.
// Must be consumed before the next encode() call.
const view = encodeUnsafe(payload);
socket.write(view);

Encode Into Pre-Allocated Buffer

import { encodeInto } from "@coderbuzz/msgpack";

const target = new Uint8Array(1024);
const bytesWritten = encodeInto(payload, target, 0);

Pre-Calculate Encoded Size

import { encodedSize } from "@coderbuzz/msgpack";

const size = encodedSize(payload);
const buf = new Uint8Array(size);
encodeInto(payload, buf);

Supported Types

| TypeScript type | MessagePack format | | -------------------- | ------------------------------------------------- | | null / undefined | nil (0xc0) | | boolean | true / false | | number (integer) | positive/negative fixint, uint8/16/32, int8/16/32 | | number (float) | float64 | | bigint | int64 / uint64 | | string | fixstr, str8, str16, str32 | | Uint8Array | bin8, bin16, bin32 | | Date | encoded as ISO string | | Array | fixarray, array16, array32 | | object | fixmap, map16, map32 |

API

// Encode a value, returning a new Uint8Array (caller owns memory)
function encode(value: unknown): Uint8Array;

// Encode a value, returning a view into the internal buffer (zero-copy)
// WARNING: invalidated by the next encode/encodeUnsafe call
function encodeUnsafe(value: unknown): Uint8Array;

// Encode a value into an existing buffer, returns bytes written
function encodeInto(
  value: unknown,
  target: Uint8Array,
  offset?: number,
): number;

// Decode a MessagePack buffer back to a value
function decode(data: Uint8Array): unknown;

// Calculate encoded byte size without allocating
function encodedSize(value: unknown): number;

License

MIT © 2026 Indra Gunawan