--- title: "@std/msgpack" description: "Encoding and decoding for the msgpack format" jsr: jsr:@std/msgpack pkg: msgpack version: 1.0.3 generated: true stability: stable --- ## Overview
This module provides functions to encode and decode MessagePack.
MessagePack is an efficient binary serialization format that is language agnostic. It is like JSON, but generally produces much smaller payloads. Learn more about MessagePack.
```js import { decode, encode } from "@std/msgpack"; import { assertEquals } from "@std/assert"; const obj = { str: "deno", arr: [1, 2, 3], bool: true, nil: null, map: { foo: "bar" } }; const encoded = encode(obj); assertEquals(encoded.length, 42); const decoded = decode(encoded); assertEquals(decoded, obj); ```MessagePack supports encoding and decoding the following types:
numberbigintstringbooleannullUint8Array