function

jsc.serialize

function serialize(
value: any,
options?: { binaryType: 'arraybuffer' }

Serializes a JavaScript value into a binary representation that can be sent to another Bun instance.

Internally, this uses the serialization format from WebKit/Safari.

@param value

The value to serialize, usually an object or array

@returns

A SharedArrayBuffer that can be sent to another Bun instance

function serialize(
value: any,
options?: { binaryType: 'nodebuffer' }
): Buffer;

Serializes a JavaScript value into a binary representation that can be sent to another Bun instance.

Internally, this uses the serialization format from WebKit/Safari.

@param value

The value to serialize, usually an object or array

@returns

A Buffer that can be sent to another Bun instance

Referenced types

interface SharedArrayBuffer