解析流JSON [英] Parse streaming JSON
本文介绍了解析流JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个正在使用的工具可以解析Neo4j响应并发出对象.
I've got a tool I'm working on that parses Neo4j responses and emits objects.
https://github.com/brian-gates/neo4j-stream-deserializer
我的问题:
- 我该如何处理错误?
- 是否有比两个解析器更好的处理标头的方法?好像是不必要的开销.
可能的错误响应如下:
{ message: 'Error explanation, ... other useful info ... }
完整示例:
https://gist.github.com/brian-gates/4a16e0aee13d6e549d52
成功的响应如下:
{ columns: [], results: [] }
推荐答案
You might be interested in Oboe.js, a library which I maintain: Oboe.js on Github
这篇关于解析流JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文