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

94 lines
1.5 KiB
Markdown

2 years ago
<p align="center">
2 years ago
<img src="https://user-images.githubusercontent.com/141232/166411036-7ef15570-c50f-4639-ba73-458ec0968b00.gif" width="500" alt="fx preview">
2 years ago
</p>
2 years ago
_* Function eXecution_
2 years ago
## Features
2 years ago
- Mouse support
- Streaming support
2 years ago
- Preserves key order
- Preserves big numbers
2 years ago
2 years ago
## Install
```bash
2 years ago
brew install fx
2 years ago
```
```bash
2 years ago
snap install fx
```
2 years ago
```bash
scoop install fx
2 years ago
```
2 years ago
```bash
pacman -S fx
```
```bash
go install github.com/antonmedv/fx@latest
```
2 years ago
Or download [pre-built binary](https://github.com/antonmedv/fx/releases).
## Usage
2 years ago
Start the interactive viewer via:
2 years ago
```bash
2 years ago
fx data.json
2 years ago
```
Or
```bash
2 years ago
curl ... | fx
2 years ago
```
2 years ago
Type `?` to see full list of key shortcuts.
2 years ago
Pretty print:
```bash
curl ... | fx .
```
2 years ago
### Reducers
2 years ago
Write reducers in your favorite language: [JavaScript](docs/reducers.md#node) (default),
[Python](docs/reducers.md#python), or [Ruby](docs/reducers.md#ruby).
2 years ago
```bash
2 years ago
export FX_LANG=node
2 years ago
fx data.json '.filter(x => x.startsWith("a"))'
2 years ago
```
```bash
2 years ago
export FX_LANG=python
fx data.json '[x["age"] + i for i in range(10)]'
```
2 years ago
```bash
2 years ago
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)