Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusion over JavaScript implementations of MessagePack

The official MessagePack page links to the page:

  • https://github.com/msgpack/msgpack-javascript

but its last update is three years ago. On the other hand, there are other implementations of MessagePack in JavaScript such as:

  • https://github.com/cuzic/MessagePack-JS
  • https://github.com/creationix/msgpack-js

What are the differences among them? Which one is the most authentic one? Which one should I use?

like image 701
sawa Avatar asked Jul 31 '13 11:07

sawa


4 Answers

Technically, https://github.com/msgpack/msgpack-javascript is the official MessagePack implementation of msgpack for JavaScript. A developer who goes by the handle "uupaa" wrote the implementation of it. He hasn't touched the code in some time.

I have an outstanding pull request that fixes a map handling issue that I hope he implements at some point. Barring that, though, I have had no problems using this library.

The reason I decided not to go with creationix's solution is because it adds JS-specific extensions to the msgpack specifiction. The extensions did not work well with other msgpack implementations.

like image 138
roncli Avatar answered Oct 24 '22 07:10

roncli


Perhaps you should try https://github.com/creationix/msgpack-js; it is the only one updated in the last few months. I'm also looking into client-side javascript libraries for MessagePack and I'm unsure of which one to use as well; they all look like suitable implementations so I'll have to just test them each out.

like image 39
Steve Benner Avatar answered Oct 24 '22 07:10

Steve Benner


Coming from the msgpack.org website I was only aware of a single JavaScript implementation, msgpack-lite by kawanet. It doesn't support the DateTime extension, though, so I went ahead and made my own library. It's very much smaller and almost as fast. It also supports exactly the official MessagePack specification, nothing more or less. You might give it a try, if you like: https://github.com/ygoe/msgpack.js I'm using it myself in combination with a C# library on the server side for WebSocket communication.

(Disclaimer: I am the author of the linked library.)

like image 33
ygoe Avatar answered Oct 24 '22 09:10

ygoe


I have restarted to maintain https://github.com/msgpack/msgpack-javascript , released as @msgpack/msgpack, with completely new codebase in TypeScript, optimized for browsers or pure ECMA-262 JavaScript engines, employing new ES features like whatwg-stream, AsyncIterator, and so on.

I wish it clear the confusions.

like image 29
FUJI Goro Avatar answered Oct 24 '22 09:10

FUJI Goro