简体   繁体   English

对MessagePack的JavaScript实现的困惑

[英]Confusion over JavaScript implementations of MessagePack

The official MessagePack page links to the page: 官方MessagePack页面链接到页面:

but its last update is three years ago. 但它的最后一次更新是三年前。 On the other hand, there are other implementations of MessagePack in JavaScript such as: 另一方面,JavaScript中还有其他MessagePack实现,例如:

What are the differences among them? 他们之间有什么不同? Which one is the most authentic one? 哪一个是最正宗的? Which one should I use? 我应该使用哪一个?

Technically, https://github.com/msgpack/msgpack-javascript is the official MessagePack implementation of msgpack for JavaScript. 从技术上讲, https://github.com/msgpack/msgpack-javascript是msgpack for JavaScript的官方MessagePack实现。 A developer who goes by the handle "uupaa" wrote the implementation of it. 通过句柄“uupaa”的开发人员编写了它的实现。 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. 我决定不使用creatix的解决方案的原因是因为它为msgpack特定添加了JS特定的扩展。 The extensions did not work well with other msgpack implementations. 这些扩展与其他msgpack实现不兼容。

Perhaps you should try https://github.com/creationix/msgpack-js ; 也许你应该尝试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; 我也在研究MessagePack的客户端javascript库,我不确定哪一个也可以使用; they all look like suitable implementations so I'll have to just test them each out. 它们看起来都是合适的实现,所以我必须每次都测试它们。

Coming from the msgpack.org website I was only aware of a single JavaScript implementation, msgpack-lite by kawanet. 来自msgpack.org网站,我只知道一个JavaScript实现,kawanet的msgpack-lite。 It doesn't support the DateTime extension, though, so I went ahead and made my own library. 但它不支持DateTime扩展,所以我继续创建自己的库。 It's very much smaller and almost as fast. 它非常小,几乎一样快。 It also supports exactly the official MessagePack specification, nothing more or less. 它也完全支持官方的MessagePack规范,或多或少。 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. 如果您愿意,可以尝试一下: https//github.com/ygoe/msgpack.js我自己将它与服务器端的C#库结合用于WebSocket通信。

(Disclaimer: I am the author of the linked library.) (免责声明:我是链接库的作者。)

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. 我已经重新启动维护https://github.com/msgpack/msgpack-javascript ,以@msgpack/msgpack发布,使用TypeScript中的全新代码库,针对浏览器或纯ECMA-262 JavaScript引擎进行了优化,采用了新的ES功能,如whatwg -stream,AsyncIterator等。

I wish it clear the confusions. 我希望清除这些混淆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM