You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fx/README.md

75 lines
1.2 KiB
Markdown

2 years ago
# fx
<p align="center"><img src="https://medv.io/assets/fx.gif" width="562" alt="fx example"></p>
_* Function eXecution_
## Install
```bash
go install github.com/antonmedv/fx@latest
2 years ago
```
Or via Homebrew
```bash
TODO
```
Or download [pre-built binary](https://github.com/antonmedv/fx/releases).
## Usage
2 years ago
Start the interactive viewer via:
2 years ago
```bash
$ fx data.json
```
Or
```bash
$ curl ... | fx
```
2 years ago
Type `?` to see full list of key shortcuts.
2 years ago
### Reducers
Write reducers in your favorite language: [JavaScript](docs/reducers.md#node),
[Python](docs/reducers.md#python), or [Ruby](docs/reducers.md#ruby).
2 years ago
```bash
$ export FX_LANG=node # Default
2 years ago
$ fx data.json '.filter(x => x.startsWith("a"))'
```
```bash
$ export FX_LANG=python
$ fx data.json '[x["age"] + i for i in range(10)]'
```
2 years ago
```bash
$ export FX_LANG=ruby
$ fx data.json 'x.to_a.map {|x| x[1]}'
2 years ago
```
2 years ago
## Documentation
2 years ago
2 years ago
See full [documentation](https://github.com/antonmedv/fx/blob/master/DOCS.md).
2 years ago
2 years ago
## Themes
2 years ago
Theme can be configured by setting environment variable `FX_THEME` from `1`
to `9`:
2 years ago
```bash
2 years ago
export FX_THEME=9
2 years ago
```
2 years ago
<img width="1214" alt="themes" src="docs/images/themes.png">
2 years ago
## License
[MIT](https://github.com/antonmedv/fx/blob/master/LICENSE)