Open boompig opened 2 years ago
It worked when I downgraded to node version 15, which points to node 16 not yet being supported by this package. It would be nice to get node16 support if possible.
You can use @msgpack/msgpack
Before check "compatibility" of your code.
var {encode, decode} = require("@msgpack/msgpack")
var { deepStrictEqual } = require("assert");
var msgpack = require('msgpack');
const object = {
nil: null,
integer: 1,
float: Math.PI,
string: "Hello, world!",
array: [10, 20, 30],
map: { foo: "bar" },
};
const encodedByMsgPack = msgpack.pack(object);
const encodedByNewLib = encode(object);
deepStrictEqual(decode(encodedByNewLib), object);
deepStrictEqual(msgpack.unpack(encodedByMsgPack), object);
deepStrictEqual(msgpack.unpack(encodedByMsgPack), decode(encodedByNewLib));
In my case it's compatible - so it's ok to change ;-)
$ yarn add msgpack