4 ms·
Show HN: A privacy-focused JSON pretty printer
- ezekg 8y agoI usually use jq [0] for this: pbpaste | jq [0]: https://stedolan.github.io/jq/ https://stedolan.github.io/jq/
- crabl 8y agoI used to do it a similar way, but often I ended up copying everything up to the final `}` character (or sometimes the input has single-quote characters rather than double-quotes), which causes the JSON to be invalid. NiceJSON takes the input (even if it's malformed), attempts to construct an abstract syntax tree using json-ast[0] and then serializes the output (which should be well-formed JSON). [0]: https://www.npmjs.com/package/json-ast https://www.npmjs.com/package/json-ast
- mustak_im 8y agoI like the idea of pasting to see the formatted output. I needed something like that - so I built this for this purpose https://devstuffs.mustak.im/formatters/json-formatter-beautifier https://devstuffs.mustak.im/formatters/json-formatter-beauti...
- timvdalen 8y agoVery nice! I have a small bug report: When you first paste something NiceJSON doesn't understand (like an image) and then you paste some valid JSON, the page will become blank (no error messages). You have to refresh and re-paste to see the JSON you tried to paste.
- crabl 8y agoThanks for the feedback, I'll look into that later :)