@cloudpss/ubjson
TypeScript icon, indicating that this package has built-in type declarations

0.5.30 • Public • Published

@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.

Package Sidebar

Install

npm i @cloudpss/ubjson

Weekly Downloads

89

Version

0.5.30

License

MIT

Unpacked Size

304 kB

Total Files

89

Last publish

Collaborators

  • opportunity