TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Library to pretty print JSON?

2 点作者 x0ner大约 14 年前
I feel like I am in Google Hell right now. Why is there not a readily available library that I could call to get a clean, pretty printing of my JSON return output within the browser.<p>The only thing I have stumbled across is: http://www.cerny-online.com/<p>While it seems to do what I want, it looks for too chunky and complicated just to get some formatted JSON. Call me lazy, but a good old git clone and a function call would be nice.<p>Is there some buried treasure out there somewhere or do I need to write my own?

4 条评论

dazmiller大约 14 年前
<a href="http://code.google.com/p/jsonview/" rel="nofollow">http://code.google.com/p/jsonview/</a> for firefox.<p><a href="https://chrome.google.com/extensions/detail/ddngkjbldiejbheifcmnfmmfiniimbbg?hl=en-gb" rel="nofollow">https://chrome.google.com/extensions/detail/ddngkjbldiejbhei...</a> for chrome.<p>There is also a website that does a decent job as well <a href="http://jsonviewer.stack.hu/" rel="nofollow">http://jsonviewer.stack.hu/</a><p>All very nice viewers mate.
评论 #2252796 未加载
_pius大约 14 年前
The JSON reference implementation [1] does this with JSON.stringify.<p>[1] <a href="https://github.com/douglascrockford/JSON-js" rel="nofollow">https://github.com/douglascrockford/JSON-js</a>
makecheck大约 14 年前
The Python standard library's "pprint" pretty-prints data structures...it might work for JSON, since it looks basically the same (though I've never tried).
krisneuharth大约 14 年前
I use this a ton: <a href="http://www.jsonlint.com/" rel="nofollow">http://www.jsonlint.com/</a>