Confusion over JavaScript implementations of MessagePack
Asked Answered
C

4

9

The official MessagePack page links to the page:

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

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

Centri answered 31/7, 2013 at 11:34 Comment(0)
A
5

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.

Avocation answered 9/5, 2014 at 20:8 Comment(1)
That repository contains three similar files without any kind of documentation. Issues are not supported. Can you explain how to use that code?Barner
D
2

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.

Deer answered 14/1, 2014 at 14:16 Comment(0)
F
2

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.

Foreground answered 31/5, 2019 at 1:40 Comment(0)
B
1

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.)

Barner answered 28/7, 2018 at 9:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.