撒拉嘿哟木头 2011-04-20 07:10 采纳率: 50%
浏览 496
已采纳

如何使用 Node.js 解析 JSON?

How should I parse JSON using Node.js? Is there some module which will validate and parse JSON securely?

转载于:https://stackoverflow.com/questions/5726729/how-to-parse-json-using-node-js

  • 写回答

29条回答 默认 最新

  • Didn"t forge 2011-04-20 07:13
    关注

    You can simply use JSON.parse.

    The definition of the JSON object is part of the ECMAScript 5 specification. node.js is built on Google Chrome's V8 engine, which adheres to ECMA standard. Therefore, node.js also has a global object JSON[docs].

    Note - JSON.parse can tie up the current thread because it is a synchronous method. So if you are planning to parse big JSON objects use a streaming json parser.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(28条)

报告相同问题?