fx/README.md
2022-04-18 23:07:36 +02:00

1.3 KiB

fx example

* Function eXecution

Features

  • Interactive terminal UI,
  • Preserves key order,
  • Preserves big numbers,
  • Use JavaScript, Python or Ruby.

Install

go install github.com/antonmedv/fx@latest

Or via Homebrew

TODO

Or download pre-built binary.

Usage

Start the interactive viewer via:

$ fx data.json

Or

$ curl ... | fx

Type ? to see full list of key shortcuts.

Reducers

Write reducers in your favorite language: JavaScript, Python, or Ruby.

export FX_LANG=node # Default
fx data.json '.filter(x => x.startsWith("a"))'
export FX_LANG=python
fx data.json '[x["age"] + i for i in range(10)]'
export FX_LANG=ruby
fx data.json 'x.to_a.map {|x| x[1]}'

Documentation

See full documentation.

Themes

Theme can be configured by setting environment variable FX_THEME from 1 to 9:

export FX_THEME=9
themes

License

MIT