TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Library to pretty print JSON?

2 pointsby x0nerabout 14 years ago
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 comments

dazmillerabout 14 years ago
<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 未加载
_piusabout 14 years ago
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>
makecheckabout 14 years ago
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).
krisneuharthabout 14 years ago
I use this a ton: <a href="http://www.jsonlint.com/" rel="nofollow">http://www.jsonlint.com/</a>