yajbe-dataformat
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

YAJBE npm package for Javascript/Typescript

YAJBE is a compact binary data format built to be a drop-in replacement for JSON (JavaScript Object Notation).

Install

$ npm install yajbe-dataformat
$ cat package.json
...
"dependencies": {
  "yajbe-dataformat": "^1.0.0",
  ...
},

Usage & Examples

A simple example using deno remote import is below. but you can use local import as usual.

import * as YAJBE from 'yajbe-dataformat';

const enc: Uint8Array = YAJBE.encode({a: "hello", b: [1, 2, 3]});
const dec = YAJBE.decode(enc); // {a: "hello", b: [1, 2, 3]}

Supported Types

Aside from the basic types supported by JSON.stringify(), YAJBE.encode() also support Map, Set, Uint8Array and the others ArrayBufferView.

TODO

Some things are not supported yet by the implementation.

  • Decode variable length float
  • Encode/Decode BigInt
  • Encode/Decode BigDecimal
  • Handle number > MAX_SAFE as BigInt?

Package Sidebar

Install

npm i yajbe-dataformat

Weekly Downloads

1

Version

1.0.1

License

Apache-2.0

Unpacked Size

43.4 kB

Total Files

5

Last publish

Collaborators

  • th30z