> msgpack
You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.
curl "https://skillshub.wtf/TerminalSkills/skills/msgpack?format=md"MessagePack — Efficient Binary Serialization
You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.
Core Capabilities
Node.js Usage
import { encode, decode, Encoder, Decoder, ExtensionCodec } from "@msgpack/msgpack";
// Basic encode/decode
const data = {
name: "Alice",
age: 30,
scores: [95, 87, 92],
active: true,
metadata: { role: "admin", lastLogin: new Date() },
};
const packed = encode(data); // Uint8Array (binary)
console.log(packed.length); // ~65 bytes vs ~120 bytes JSON
const unpacked = decode(packed); // Original object
// Custom extension for Date
const extensionCodec = new ExtensionCodec();
extensionCodec.register({
type: 0, // Extension type ID (0-127)
encode: (input: unknown) => {
if (input instanceof Date) {
return encode(input.getTime());
}
return null;
},
decode: (data: Uint8Array) => {
return new Date(decode(data) as number);
},
});
const encoder = new Encoder({ extensionCodec });
const decoder = new Decoder({ extensionCodec });
// Streaming decode for large data
import { decodeMultiStream } from "@msgpack/msgpack";
for await (const item of decodeMultiStream(readableStream)) {
processItem(item);
}
// WebSocket with MessagePack
ws.binaryType = "arraybuffer";
ws.onmessage = (event) => {
const data = decode(new Uint8Array(event.data));
handleMessage(data);
};
ws.send(encode({ type: "subscribe", channel: "metrics" }));
Comparison
const testData = { users: Array.from({ length: 1000 }, (_, i) => ({
id: i, name: `User ${i}`, email: `user${i}@example.com`, score: Math.random() * 100,
}))};
// JSON: 89,234 bytes, encode 2.1ms, decode 3.4ms
// MessagePack: 52,847 bytes (41% smaller), encode 0.8ms, decode 1.2ms
Installation
npm install @msgpack/msgpack # JavaScript/TypeScript
pip install msgpack # Python
go get github.com/vmihailenco/msgpack/v5 # Go
Best Practices
- Replace JSON for internal APIs — Use MessagePack between microservices; keep JSON for public APIs (human-readable)
- WebSocket payloads — Use MessagePack for real-time binary data over WebSocket; smaller frames, faster parsing
- Cache storage — Store MessagePack in Redis/Memcached; 30-50% less memory than JSON strings
- Extension types — Register custom types (Date, BigInt, Decimal) with extension codec; type-safe round-trip
- Streaming decode — Use
decodeMultiStreamfor large datasets; process items as they arrive - Content-Type — Use
application/x-msgpackorapplication/msgpackheader for HTTP APIs - Schema evolution — Like JSON, MessagePack is schema-less; add/remove fields freely
- Fallback to JSON — Support both formats via Accept header; MessagePack for performance, JSON for debugging
> related_skills --same-repo
> zustand
You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.
> zoho
Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.
> zod
You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.
> zipkin
Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.