Detalhes do pacote

@cloudpss/ubjson

opportunity243MIT0.5.48

Opinionated UBJSON encoder/decoder for CloudPSS.

ubjson, universal binary json, json, binary

readme (leia-me)

@cloudpss/ubjson

Opinionated UBJSON encoder/decoder for CloudPSS.

Inspired by https://bitbucket.org/shelacek/ubjson, optimized for huge objects.

API

encode(value: unknown): Uint8Array

Encode JS value to UBJSON binary data.

Uint8Array, Int8Array, Int16Array, Int32Array, Float32Array, Float64Array are recognized and encoded as optimized object format. Other type of typed arrays are not supported.

decode(value: Uint8Array): unknown

Decode UBJSON binary data to JS value.

Numeric array of optimized object format will be decoded into corresponding typed arrays. Int64 (L) and high-precision number (H) are not supported.