mirror of https://github.com/antonmedv/fx
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.
98d886da20 | 5 years ago | |
---|---|---|
.gitignore | 7 years ago | |
.travis.yml | 6 years ago | |
DOCS.md | 5 years ago | |
LICENSE | 6 years ago | |
README.md | 5 years ago | |
bang.js | 5 years ago | |
config.js | 6 years ago | |
find.js | 6 years ago | |
fx.js | 5 years ago | |
index.js | 5 years ago | |
package.json | 5 years ago | |
print.js | 6 years ago | |
reduce.js | 5 years ago | |
std.js | 5 years ago | |
stream.js | 6 years ago | |
test.js | 5 years ago |
README.md
* Function eXecution
Command-line JSON processing tool
Features
- Easy to use
- Standalone binary
- Interactive mode 🎉
- Streaming support 🌊
Install
$ npm install -g fx
Or via Homebrew
$ brew install fx
Or download standalone binary from releases page.
Usage
Start interactive mode without passing any arguments.
$ curl ... | fx
Or by passing filename as first argument.
$ fx data.json
Pass a few JSON files.
cat foo.json bar.json baz.json | fx .message
Use full power of JavaScript.
$ curl ... | fx '.filter(x => x.startsWith("a"))'
Access all lodash (or ramda, etc) methods by using .fxrc file.
$ curl ... | fx '_.groupBy("commit.committer.name")' '_.mapValues(_.size)'
Update JSON using spread operator.
$ echo '{"count": 0}' | fx '{...this, count: 1}'
{
"count": 1
}
Print formatted JSON to stdout.
$ curl ... | fx .
Pipe JSON logs stream into fx.
$ kubectl logs ... -f | fx .message
And try this:
$ fx --life
Documentation
See full documentation.
Links
Related
- gofx – fx-like JSON tool (go)
- eat – converts anything into JSON
- ymlx – fx-like YAML cli processor
- fx-completion – bash completion for fx
- fx-theme-monokai – monokai theme
- fx-theme-night – night theme