Looks great! What is the website https://fx.wtf/ built-in?
Fx – Terminal JSON Viewer
51–60 of 80 posts
Re: Fx – Terminal JSON Viewer
#52Earlier quoted context omitted.
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
#53Re: Fx – Terminal JSON Viewer
#54Re: Fx – Terminal JSON Viewer
#55Re: Fx – Terminal JSON Viewer
#56Hey 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. *…
- Some indication of how far down you've scrolled would be useful for "situational awareness". Perhaps a percentage number in the status bar (like emacs/vim?)
- I miss not having the Home/End keys bound to the goto top/bottom actions
- The cursor behavior when pressing PageDn/PageUp throws me off.
Emacs when pressing PageDn: Cursor ends up at the top of the window.
Vim: Cursor stays at the current position.
notepad.exe: Cursor ends up in the middle of the window.
Fx: Cursor ends up at the bottom of the window.
- The . navigation is very neat with the tab completion. Probably stupid observation: If you remove the alphabet key shortcuts you wouldn't need the (non-discoverable) dot. :)
Re: Fx – Terminal JSON Viewer
#57Might wanna change to something else.
Re: Fx – Terminal JSON Viewer
#58Earlier quoted context omitted.
Equivalent jq seems okay here: echo '{"name": "world"}' | jq '"Hello \(.name)"'
jq seems shorter but I don't see how it's more intuitive - ".name" is pretty basic jq syntax but how do I know \() is syntax for wrapping selectors within strings? I've used jq for many years and tbh I've never done string templating with it, so I would need to go digging in the docs. You can argue that's the case for any language, but it's the fundamental reason DSLs rarely capture the mainstream for on-the-fly util…
Re: Fx – Terminal JSON Viewer
#59Earlier quoted context omitted.
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?
It's basically https://json5.org/ CUE will happily take your JSON with comments and extra commas, or no commas too (lists still need them), most keys can be unquoted, and it's just a one-liner to get valid json or yaml from it
Re: Fx – Terminal JSON Viewer
#60Earlier quoted context omitted.
Yes and both can be expressed in js and jq. Poinjt is what JS is known by much more peopel. As fx uses Node or Deno we for example can use lodash in fx: fx '_.groupBy("commit.author.name")' '_.mapValues(size)' '_.toPairs' '_.sortBy(1)' '_.reverse' '_.take(10)' '_.fromPairs' To do if in jq, it will take me much more time and extensive documentation reading.
What’s the original JSON? Happy to try and express this in jq
I'm looking forward to your jq version. I love jq and use it all the time, but for anything of that complexity, I'd probably just use Python.