Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/kwik/deps.ts>msgpack.encode

Kwik is a deno database using messagepack files.
Go to Latest
function msgpack.encode
Re-export
import { msgpack } from "https://deno.land/x/kwik@v1.2.3/deps.ts";
const { encode } = msgpack;

It encodes value in the MessagePack format and returns a byte buffer.

The returned buffer is a slice of a larger ArrayBuffer, so you have to use its #byteOffset and #byteLength in order to convert it to another typed arrays including NodeJS Buffer.

Type Parameters

optional
ContextType = undefined

Parameters

value: unknown
optional
options: EncodeOptions<SplitUndefined<ContextType>>

Returns

Uint8Array