浏览器可以使用二进制 JSON javascript 库吗?
为了高效的服务器端解析,我正在寻找直接用于浏览器 JavaScript 环境的 BSON 解决方案。这个想法是通过二进制 websocket 来利用整个 ASCII 空间。有什么建议吗?
(也欢迎任何 Nodejs 建议)
另请参阅: http://bsonspec.org/
In order for efficient server side parsing I am looking into a BSON solution directly for the browser javascript environment. The idea is to utilize the entire ASCII space by means of binary websockets. Any suggestions?
(Any nodejs suggestions are welcome as well)
See also:
http://bsonspec.org/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无论如何,MongoDB 团队现在似乎有一个受支持的 Javascript BSON 项目:
https://github。 com/mongodb/js-bson
我不是这个库的专家,但该项目声称可以在 Node 和浏览器中工作。下面是他们网站上的修改示例:
下面是我在 Chrome 中的结果:
For what it's worth, it appears that the MongoDB team now have a supported Javascript BSON project:
https://github.com/mongodb/js-bson
I'm no expert with the library, but the project claims to work in both Node and the browser. Below is a modified sample from their site:
Below are my results in Chrome:
这可能不完整,但该项目的目标与您想要的一致: https://github.com/ muhmi/javascript-bson 它看起来不像直接编码为类型化数组,而这对于通过 WebSocket 发送最有用。
This might be incomplete but the goal of the project line up with what you want: https://github.com/muhmi/javascript-bson It doesn't look like that encodes directly to typed arrays which would be the most useful for sending over WebSocket.