Go to file
2018-12-08 16:38:59 +07:00
.gitignore Add standalone binary dist 2018-01-27 06:44:19 +07:00
.travis.yml ci: test Node.js 8, 10 and 11 (#26) 2018-11-08 14:42:32 +07:00
config.js Make autocomplete configurable 2018-12-02 23:24:47 +07:00
docs.md Add vim motions to box.key (j/k/h/l) 2018-12-05 09:54:00 +07:00
fx.js Fix hanging cursor after collapse all 2018-12-08 16:38:59 +07:00
index.js Improve DX 2018-12-02 23:24:47 +07:00
LICENSE Create LICENSE 2018-01-26 00:57:38 +07:00
package.json Release 9.0.0 2018-12-07 23:43:56 +07:00
print.js Improve JSON.stringify compatibility 2018-12-07 22:51:10 +07:00
README.md Update README.md 2018-12-03 23:05:21 +07:00
reduce.js Add better detection of functions in reduce 2018-12-07 23:33:55 +07:00
test.js Add better detection of functions in reduce 2018-12-07 23:33:55 +07:00

fx

fx example

* Function eXecution

Build Status Npm Version Brew Version

Command-line JSON processing tool

Features

  • Formatting and highlighting
  • Standalone binary
  • Interactive mode 🎉
  • Themes 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

Pipe into fx any JSON and anonymous function for reducing it.

$ curl ... | fx 'json => json.message'

Or same as above but short.

$ curl ... | fx this.message
$ curl ... | fx .message

Pass any numbers of arguments as code.

$ curl ... | fx 'json => json.message' 'json => json.filter(x => x.startsWith("a"))' 

Access all lodash (or ramda, etc) methods by using .fxrc file.

$ curl ... | fx '_.mapValues(_.groupBy(this, "commit.committer.name"), _.size)'

Update JSON using spread operator.

$ echo '{"count": 0}' | fx '{...this, count: 1}'
{
  "count": 1
}

Pretty print JSON with dot.

$ curl ... | fx .

Documentation

See full documentation.

License

MIT