Live data from Hacker News

Fx – Terminal JSON Viewer

fx.wtf

11–20 of 80 posts

Re: Fx – Terminal JSON Viewer

#11
Would've been awesome if results are displayed under the commands. For example, command

  echo '{"name": "hello"}\n{"name": "world"}' | fx '.name'
would output what? My guess is hello world but it might be hello\nworld.

Re: Fx – Terminal JSON Viewer

#13
post #10

Having used https://jqlang.github.io/jq/ , wondering your pitch on advantages, alternative use cases for using fx?

Not OP but

      echo '{"name": "world"}' | fx 'x => x.name' 'x => `Hello, ${x}!`'
Is immediately grokkable compared to jq's syntax.

I love jq, I think it's extremely powerful, but I have to load up the documentation in a side window every time I have use it.

Re: Fx – Terminal JSON Viewer

#15
post #10

Having used https://jqlang.github.io/jq/ , wondering your pitch on advantages, alternative use cases for using fx?

Not OP but echo '{"name": "world"}' | fx 'x => x.name' 'x => `Hello, ${x}!`' Is immediately grokkable compared to jq's syntax. I love jq, I think it's extremely powerful, but I have to load up the documentation in a side window every time I have use it.

Equivalent jq seems okay here:

    echo '{"name": "world"}' | jq '"Hello \(.name)"'

Re: Fx – Terminal JSON Viewer

#16
post #2

Hey HN friends! I've taken `fx` back to the drawing board and completely rewritten it from the ground up. Excited to share what's new: 1. *Going Big*: `fx` now gracefully handles even the most massive JSON files. 2. *A New TUI Look*: Dive deep into your data with a revamped terminal interface—now with themes! 3. *Swift Navigation with Dig Fuzzy Search*: Feeling lost in JSON? Just type `.` and navigate with ease. 4. *…

wow nice, I'll give this a try. I've always used jq for viewing json, but it's the wrong tool for my use. I basically want to explore json interactively, not parse it specifically. So the workflow is to keep "jq"ing it, and modifying my jq query until I find what I'm looking for. Your tool looks like it allows interactive exploration.

You may be interested in an interactive jq tool like jiq or others: https://github.com/fiatjaf/awesome-jq (do a ctrl-f for "interactive" on this page).

Re: Fx – Terminal JSON Viewer

#17
The other day, I found myself in need of visualising a tree of paths, like this:

  /one/two
  /one/three/four
  /one/three/five
  /six
I ended up converting it to a JSON with a one-off Python script, and then using fx for the viewing. It worked very well! Thank you for the tool!

(Incidentally, I’ve been writing my own viewer [0] to satisfy my original need more straightforwardly, but that’s still in very early stages.)

[0]: https://github.com/nathell/treeviewer

Re: Fx – Terminal JSON Viewer

#20
post #2

Hey HN friends! I've taken `fx` back to the drawing board and completely rewritten it from the ground up. Excited to share what's new: 1. *Going Big*: `fx` now gracefully handles even the most massive JSON files. 2. *A New TUI Look*: Dive deep into your data with a revamped terminal interface—now with themes! 3. *Swift Navigation with Dig Fuzzy Search*: Feeling lost in JSON? Just type `.` and navigate with ease. 4. *…

Hello,

Is there a commonly-used grammar for "json with comments and trailing commas" or does everyone just try to copy the jsonc from vscode?

Post reply on HN