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.
 
 
 
 
Go to file
Anton Medvedev 001252c1ca Release 17.0.0 4 years ago
.gitignore Add standalone binary dist 6 years ago
.travis.yml ci: test Node.js 8, 10 and 11 (#26) 6 years ago
DOCS.md Add support for query languages 4 years ago
LICENSE Update LICENSE 5 years ago
README.md Update README.md 4 years ago
bang.js Add edit-in-place feature 5 years ago
config.js Show status bar if pattern not found 6 years ago
find.js Search on keys, not paths 6 years ago
fx.js Add comment about terminal resize 5 years ago
index.js Add lossless json 4 years ago
install.sh Add install.sh 4 years ago
package.json Release 17.0.0 4 years ago
print.js Add lossless json 4 years ago
reduce.js Add support for query languages 4 years ago
std.js Add edit-in-place feature 5 years ago
stream.js Add lossless json 4 years ago
test.js Add lossless json 4 years ago

README.md

fx logo

fx example

* Function eXecution

Build Status Npm Version Brew Version

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

bash <( curl -LAx https://bit.ly/get-fx )

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.

License

MIT