Earlier quoted context omitted.
It can also happen you don’t care about the data you are sharing. Why not using an online then?
Still too dangerous, and I don't trust new developers to make that determination. Once you get into the habit of pasting development details into random website textboxes hosted who-knows-where with who-knows-what ad networks, you're one keystroke away from leaking sensitive details that are correlated to your employer's IP range. Or maybe I'm a crank and need to lighten up. That's why I'm asking.
Show HN: JSON Pizza – Beautify your JSON quickly
41–50 of 81 posts
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#42Re: Show HN: JSON Pizza – Beautify your JSON quickly
#43Non web based approach using jq ( https://stedolan.github.io/jq/ ): json_source_on_stdout | jq .
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#44Earlier quoted context omitted.
Or cat foo.json | python3 -m json.tool Prettifying is also built in to python3 on any system.
useless use of cat: python3 -m json.tool foo.json
:) cat foo.json
[oh crap]
:) cat foo.json | python -m foo.tool
For the 2nd command I'd hit "[up] | pyth[tab] -m json.tool"Re: Show HN: JSON Pizza – Beautify your JSON quickly
#45OS X includes the json_pp command, so I often just do this to format JSON in my clipboard: pbpaste | json_pp | pbcopy For just viewing, I like Node's console.dir() formatting better since it's more compact and colored (but it's unquoted JS objects, not JSON), so I aliased this command in my shell: json='node -e '\''console.dir(JSON.parse(fs.readFileSync("/dev/stdin", "utf-8")), { depth: null })'\' Then I can do pbpas…
If you have `jq` installed then you can just pipe any JSON to `jq` and it will beautify and colorize it automatically. pbpaste | jq
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#46You can also just open chrome / firefox dev tools console and assign it to a variable...
Sadly, all of these tools fall over for very large json objects
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#47Not to threadcrap, but I am curious what people think about this. Over the years I've seen a lot of developers take none open-source code, or private JSON data strings and paste them into random sites they find searching "json format" on google. Does that make anyone else cringe? Is there anything we can do about this? Or is this just not a big deal and I shouldn't worry.
You can do the same in the browser console. I don't really get why people need an online tool for this: copy(JSON.stringify(obj, null, 2)) obj can be parsed with JSON.parse if it is in text.
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#48Re: Show HN: JSON Pizza – Beautify your JSON quickly
#49Not to threadcrap, but I am curious what people think about this. Over the years I've seen a lot of developers take none open-source code, or private JSON data strings and paste them into random sites they find searching "json format" on google. Does that make anyone else cringe? Is there anything we can do about this? Or is this just not a big deal and I shouldn't worry.
There are some things you just shouldn't paste into the internet.