Command-line tool and terminal JSON viewer πŸ”₯
Branch: master
Clone or download
Latest commit f321b8a Feb 9, 2019

README.md

fx logo

fx example

* Function eXecution

Build Status Npm Version Brew Version Snap 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 '_.groupBy("commit.committer.name")' '_.mapValues(_.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.

Links

Related

Contributing

Open in Gitpod

Or clone locally and run:

# install dependencies
npm install

# run fx
node index.js package.json

# run the build
npm run build

# try the built binary
./dist/fx-linux package.json

License

MIT