Live data from Hacker News

Show HN: JSON Pizza – Beautify your JSON quickly

json.pizza

31–40 of 81 posts

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#31
post #27
post #19

Not 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.

I had a junior dev show me a neat site where you can paste in a Java thread dump and it performs an analysis. After explaining why it's a bad practice to send diagnostic details to an un-trusted third party I think he understood, but it seems like every week I'm finding people using ngrok, unauthorized password managers, grammarly, JWT parsers, Base64 encoders, and all manner of questionable tools. I too wonder if I'…

It can also happen you don’t care about the data you are sharing. Why not using an online then?

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#33

OS 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…

Or

    cat foo.json | python3 -m json.tool
Prettifying is also built in to python3 on any system.

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#34
post #33

OS 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…

Or cat foo.json | python3 -m json.tool Prettifying is also built in to python3 on any system.

Or

    jq  . foo.json

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#36
post #27

Earlier quoted context omitted.

I had a junior dev show me a neat site where you can paste in a Java thread dump and it performs an analysis. After explaining why it's a bad practice to send diagnostic details to an un-trusted third party I think he understood, but it seems like every week I'm finding people using ngrok, unauthorized password managers, grammarly, JWT parsers, Base64 encoders, and all manner of questionable tools. I too wonder if I'…

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.

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#38
post #33

OS 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…

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

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#39

OS 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
Post reply on HN