Live data from Hacker News

Show HN: JSON Pizza – Beautify your JSON quickly

json.pizza

21–30 of 81 posts

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

#21
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 always quickly check my Chrome Inspector to make sure it's not sending anything to a server.

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

#22
post #21
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 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 something that looks like a hash or a token, or has a keyword like "password."

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

#25

Feedback: First time through I just pasted some JSON and wondered why it didn't format. I hadn't realised the page had instructions on it – I had assumed it was just sample JSON. Second time through, I read the instructions, and realised that the keyboard shortcuts are Control-based – this is less common for macOS, "Cmd+Enter" feels like a more consistent shortcut to use. I think this should probably just auto-format…

Do what https://prettier.io/playground/ does and have two windows so one autoformats.

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

#26
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.

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

#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'm out of touch, if I'm tilting at windmills.

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

#28
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

   pbpaste | json

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

#29
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.

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

#30
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.

This is what keeps our security industry employed. Anything like a pastebin is blocked at my workplace.
Post reply on HN