July 11, 2019

231 words 2 mins read

antonmedv/fx

antonmedv/fx

Command-line tool and terminal JSON viewer

repo name antonmedv/fx
repo link https://github.com/antonmedv/fx
homepage https://fx.wtf
language JavaScript
size (curr.) 163 kB
stars (curr.) 9514
created 2018-01-25
license MIT License

* 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 -L https://fx.wtf )

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

comments powered by Disqus