Skip to main content
Module

x/msgpack_rpc/deps.ts>encode

🦕 Deno module to support msgpack-rpc
Latest
function encode
import { encode } from "https://deno.land/x/msgpack_rpc@v4.0.0/deps.ts";

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

ContextType

Parameters

value: unknown
optional
options: EncodeOptions<SplitUndefined<ContextType>> = [UNSUPPORTED]

Returns

Uint8Array