Earlier quoted context omitted.
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.
Even better, just open the JSON file in Firefox.
Show HN: JSON Pizza – Beautify your JSON quickly
51–60 of 81 posts
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#52Non web based approach using jq ( https://stedolan.github.io/jq/ ): json_source_on_stdout | jq .
I want to like jq, and for doing a simple lookup it's great, but I find when I try to do something complicated the syntax just doesn't click.
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#53OS 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…
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#54Earlier quoted context omitted.
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
#55Earlier 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.
> I don't trust new developers to make that determination.
Ignoring this issue is a sign of professional immaturity. Recommend you view it as an opportunity to educate the younger members of your team. Show them the power of a solid CLI toolbox that respects your privacy while delivering solid performance.
Still, you shouldn't be dogmatic about it. Webapp tools can be useful for understanding a new programming language or API. Just be judicious.
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#56Not 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'…
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#57Earlier quoted context omitted.
I want to like jq, and for doing a simple lookup it's great, but I find when I try to do something complicated the syntax just doesn't click.
I know, right? I've switched to using jp: its syntax is based on an actual standard and it clicks much more with me than jq's syntax. https://github.com/jmespath/jp
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#58Not 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'…
At least ngrok supports end-to-end TLS tunnels[0], where you use your own TLS key/certs and the ngrok server never sees plaintext (the ngrok client is also open source, so for the truly paranoid you can examine it to ensure it isn't doing anything nefarious).
But I agree... I've seen people at a company where I used to work pasting sensitive data into a public pastebin. It still hurts my brain to think about it.
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#59Not 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.
It drives me crazy when I see people do it. For the most part tools like VSCode have plugins for it as well, so no need to send this stuff to random third party. The biggest struggle for me is diffing random bits of text. Pulling two JSON docs from the DB and wanting to compare them. Recently found a VSCode plugin that makes it a bit better, but still a pain in the ass.
Re: Show HN: JSON Pizza – Beautify your JSON quickly
#60Earlier quoted context omitted.
I always quickly check my Chrome Inspector to make sure it's not sending anything to a server.
Don't count on this. There are ways to guess if the dev tools are likely to be open and then alter nefarious behavior based on that. For example you can detect changes in window sizes or look for plugins that are in the global namespace (e.g. Redux Dev Tools). Better play it safe and don't copy and paste private data to random sites. Another attack vector would be to avoid sending down any data unless it contains som…