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
Yury Shulaev 8a9e1f39d5
Prevent "reduce" name collision (#177)
2 years ago
.gitignore Add standalone binary dist 6 years ago
.travis.yml Update travis node version 4 years ago
DOCS.md Add shift left collapse (#144) 4 years ago
LICENSE Update LICENSE 5 years ago
README.md Update README.md 3 years ago
bang.js Add edit-in-place feature 4 years ago
config.js Show status bar if pattern not found 5 years ago
find.js Search on keys, not paths 5 years ago
fx.js Add shift left collapse (#144) 4 years ago
index.js fix: set exit code to zero when fx --version (#148) 4 years ago
package.json Release 20.0.2 4 years ago
print.js Add lossless json 4 years ago
reduce.js Prevent "reduce" name collision (#177) 2 years ago
std.js Use LosslessJSON in reduce function 4 years ago
stream.js Use LosslessJSON in reduce function 4 years ago
test.js Add support for .[] 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

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
}

Extract values from maps.

$ fx commits.json | fx .[].author.name

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