Skip to main content
Module

x/web_bson/mod.d.ts>serializeWithBufferAndIndex

web_bson is a fork from mongodb/js-bson
Very Popular
Latest
function serializeWithBufferAndIndex
import { serializeWithBufferAndIndex } from "https://deno.land/x/web_bson@v0.3.0/mod.d.ts";

Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.

Parameters

object: Document
  • the Javascript object to serialize.
finalBuffer: Uint8Array
  • the Buffer you pre-allocated to store the serialized BSON object.
optional
options: SerializeOptions

Returns

number

the index pointing to the last written byte in the buffer.