Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

encode

import { encode } from "https://raw.githubusercontent.com/aaronhuggins/cbor-redux/0c8b3f4fa619fee986dd91e254d999fc9cfd396e/mod.ts";

Converts a JavaScript value to a Concise Binary Object Representation (CBOR) buffer.

function encode<T = any>(value: T, replacer?: CBORReplacer | null): ArrayBuffer;
§
encode<T = any>(value: T, replacer?: CBORReplacer | null): ArrayBuffer
[src]

§Type Parameters

§
T = any
[src]

§Parameters

§
value: T
[src]
  • A JavaScript value, usually an object or array, to be converted.
§
replacer?: CBORReplacer | null optional
[src]
  • A function that alters the behavior of the encoding process. If replacer is null or not provided, all properties of the object are included in the resulting CBOR buffer.

§Return Type

§
ArrayBuffer
[src]

The JavaScript value converted to CBOR format.