Ask HN: Local Tools for Viewing JSON

4 points by slickrick216 ↗ HN
Looking for tools to view large varying JSONs. I know I could beautify or flatten them etc but wondering if anyone else has created a tool for this.

10 comments

[ 2.0 ms ] story [ 35.9 ms ] thread
VS Code has lots of plugins for working with JSON. The only problem is that you have to use VS Code.
What's wrong with VS Code?
The UX is mediocre due to their refusal to add GUI elements we've had since the 80s because the product can't be allowed to compete against Visual Studio.
What are some such features?

I've used Visual Studio before, and one thing that annoys me about VS Code is that I can't just drag a tab out to a new window and have it be connected to the same project or session or whatever.

Even if one uses "new window" and moves the tab, things occur such as it not picking up imports, etc.

At this point, if you're missing a critical feature or GUI in VS Code its because you're probably missing a config or a plugin.
Looks out of place, does not follow the GNOME HIG as opposed to better text editors/IDEs. Furthermore the text rendering looks weird and feels laggy, at least for me another factor is the use of electron and how opaque VSCode is as opposed to e.g. GNOME Builder.

For GNOME-Builder, if I want to debug LSP-issues, I add "--env=JSONRPC_DEBUG=1" to the commandline and I get nice output. For VSCode? - No idea. In the end I redirected strace for writes to a file and then grepped for "Content-Length", because I was frustrated that there was no straightforward way to do this otherwise.

Another issue I have with VSCode is, that it adds some folders to the project, that's something I absolutely can't stand.

Thanks, Yeah I’ve tried VSCode and Sublime. Like you said they aren’t bad. Might need to check out more plugins.
jq (command-line app)

or you could write a small javascript and run it via node

Honestly it’s hard to beat text formats for viewing JSON unless you have particular queries. There’s just a lot of data no matter which way you try to represent it

In addition to jq (already mentioned) here are some other useful CLI tools for dealing with JSON data. Descriptions are directly from GitHub. Note: dsq also has a companion GUI app called DataStation[0] if you're looking for that.

fx: Command-line JSON processing tool - https://github.com/antonmedv/fx

dasel: JSON, YAML, TOML, XML, and CSV query and modification tool - https://github.com/TomWright/dasel

dsq: CLI tool for running SQL queries against JSON, CSV, Excel, Parquet, and more - https://github.com/multiprocessio/dsq

gron: Make JSON greppable - https://github.com/tomnomnom/gron

jello: Filter JSON and JSON Lines data with Python syntax - https://github.com/kellyjonbrazil/jello

jless: Command-line pager for JSON data - https://github.com/PaulJuliusMartinez/jless

jid: Json incremental digger - https://github.com/simeji/jid

jql: JSON query language CLI tool - https://github.com/yamafaktory/jql

qp: Command-line (ND)JSON querying - https://github.com/paybase/qp

[0]: https://github.com/multiprocessio/datastation

I would add VisiData to that list. It is more suited for tabular data, but it can be used to explore large nested data. I find it is a good starting place to explore json data I'm not familiar with. I will also sometimes flatten the data with some general jq scripts or gron.

If I'm trying to understand some new json data, I start with visidata, and then I poke around to find the data I want. If it is data I want to extract again, I use jq to get the interesting bits. Sometimes I use that in combination with sqlite-utils to store that data so I can query it. (I haven't tried some of the other tools that will create a sqlite database for you.)

- https://github.com/saulpw/visidata - https://github.com/simonw/sqlite-utils