require("tslib")
const {JsonEncoder} = require('json-joy/es2020/json-pack/json/JsonEncoder');
const {JsonDecoder} = require('json-joy/es2020/json-pack/json/JsonDecoder');
const {Writer} = require('json-joy/es2020/util/buffers/Writer');
const obj = {
foo: 1,
bar: "hello",
binary: new Uint8Array([1, 2, 3]),
};
const encoder = new JsonEncoder(new Writer());
const encoded = encoder.encode(obj);
const decoder = new JsonDecoder();
const decoded = decoder.read(encoded);
console.log(decoded);