@alexgyver/bson
v2.1.1
Published
Decode BSON from BSON Arduino library
Readme
bson.js
Распаковщик и запаковщик бинарного JSON для библиотеки BSON.
npm i @alexgyver/bson
const codes = [
'some',
'string',
'constants',
];
let test = {
int: 123,
float: 3.14,
arr: [
"str",
true,
1234,
new Uint8Array([1, 2, 3]),
],
obj: {
str2: "str2",
true: true,
},
str3: "str3",
nul: null,
[getCode('constants', codes)]: getCode('string', codes),
bins: new Uint8Array([1, 2, 3]),
};
let enc = encodeBson(test);
let json = decodeBson(enc, codes);
console.log(json);