fx/README.md

94 lines
1.4 KiB
Markdown
Raw Normal View History

2022-05-03 06:18:16 +00:00
<p align="center"><a href="https://fx.wtf"><img src="https://medv.io/assets/fx/fx-preview.gif" width="500" alt="fx preview"></a></p>
2022-04-16 20:15:18 +00:00
_* Function eXecution_
2022-04-18 21:07:36 +00:00
## Features
2022-04-25 20:41:54 +00:00
- Mouse support
2022-04-29 21:17:39 +00:00
- Streaming support
2022-04-18 21:08:04 +00:00
- Preserves key order
- Preserves big numbers
2022-04-18 21:07:36 +00:00
2022-04-16 20:15:18 +00:00
## Install
```bash
2022-04-23 17:50:11 +00:00
brew install fx
2022-04-16 20:15:18 +00:00
```
```bash
2022-04-23 17:50:11 +00:00
snap install fx
```
2022-04-16 20:15:18 +00:00
```bash
scoop install fx
2022-04-16 20:15:18 +00:00
```
2022-04-23 17:50:11 +00:00
```bash
pacman -S fx
```
```bash
2022-05-06 05:40:05 +00:00
pkg install fx
```
```bash
2022-04-23 17:50:11 +00:00
go install github.com/antonmedv/fx@latest
```
2022-04-16 20:15:18 +00:00
Or download [pre-built binary](https://github.com/antonmedv/fx/releases).
## Usage
2022-04-17 21:04:58 +00:00
Start the interactive viewer via:
2022-04-16 20:15:18 +00:00
```bash
2022-04-18 21:20:53 +00:00
fx data.json
2022-04-16 20:15:18 +00:00
```
Or
```bash
2022-04-18 21:20:53 +00:00
curl ... | fx
2022-04-16 20:15:18 +00:00
```
2022-04-17 21:04:58 +00:00
Type `?` to see full list of key shortcuts.
2022-04-18 21:20:53 +00:00
Pretty print:
```bash
curl ... | fx .
```
2022-04-16 20:15:18 +00:00
### Reducers
2022-05-08 15:03:22 +00:00
Write reducers in your favorite language: [JavaScript](doc/doc.md#reducers) (default),
[Python](doc/doc.md#python), or [Ruby](doc/doc.md#ruby).
2022-04-18 21:02:55 +00:00
2022-04-16 20:15:18 +00:00
```bash
2022-04-18 21:04:23 +00:00
fx data.json '.filter(x => x.startsWith("a"))'
2022-04-16 20:15:18 +00:00
```
2022-04-18 21:02:55 +00:00
```bash
2022-04-18 21:04:23 +00:00
fx data.json '[x["age"] + i for i in range(10)]'
2022-04-18 21:02:55 +00:00
```
2022-04-16 20:15:18 +00:00
```bash
2022-04-18 21:04:23 +00:00
fx data.json 'x.to_a.map {|x| x[1]}'
2022-04-16 20:15:18 +00:00
```
2022-04-17 21:04:58 +00:00
## Documentation
2022-04-16 20:15:18 +00:00
2022-05-08 15:03:22 +00:00
See full [documentation](doc/doc.md).
2022-04-16 20:15:18 +00:00
2022-04-17 21:04:58 +00:00
## Themes
2022-04-16 20:15:18 +00:00
2022-04-18 21:02:55 +00:00
Theme can be configured by setting environment variable `FX_THEME` from `1`
to `9`:
2022-04-16 20:15:18 +00:00
```bash
2022-04-17 21:04:58 +00:00
export FX_THEME=9
2022-04-16 20:15:18 +00:00
```
2022-05-08 15:03:22 +00:00
<img width="1214" alt="themes" src="doc/images/themes.png">
2022-04-16 20:15:18 +00:00
2022-05-08 15:44:48 +00:00
Add your own themes in [theme.go](pkg/theme/theme.go) file.
2022-04-16 20:15:18 +00:00
## License
2022-05-08 15:03:22 +00:00
[MIT](LICENSE)