Quark
#
Modules #
quark/actionquark/appquark/bubblesquark/bufferquark/checkboxquark/cssquark/ctrquark/defsquark/dialogquark/eventquark/fontquark/fsquark/hashquark/httpquark/indexquark/jsonbquark/keyboardquark/lmdbquark/mediaquark/navquark/netquark/osquark/pathquark/pkgquark/screenquark/statequark/stepperquark/storagequark/testquark/typesquark/uriquark/utilquark/viewquark/windowquark/wsquark/_bufferquark/_commonquark/_decoratorsquark/_eventquark/_extquark/_md5quark/_sha1quark/_sha256quark/_utilquark/_watching
Quark v1.4.0 Documentation
quark/jsonb #
default #
default.binaryify(obj) #
Convert a JSON object to binary format.
binaryify(obj: any): Buffer
Parameters:
obj— - The object to convert.
Returns: - The binary representation of the object.
For example:
const jsonb = require('quark/jsonb');
const binaryData = jsonb.binaryify({ key: 'value' });
console.log(binaryData); // Outputs the binary data.
@throws{Error} - If the object cannot be serialized.
default.parse(buf) #
Parse a binary buffer back to a JSON object.
parse(buf: Uint8Array): any
Parameters:
buf— - The binary data to parse.
Returns: - The parsed JSON object.
For example:
const jsonb = require('quark/jsonb');
const jsonData = jsonb.parse(binaryData);
console.log(jsonData); // Outputs the original JSON object.
@throws{Error} - If the buffer cannot be parsed.