Skip to content
Command-line tool and terminal JSON viewer πŸ”₯
JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add standalone binary dist Jan 26, 2018
.travis.yml
DOCS.md Fix expand all under cursor and add docs Nov 6, 2019
LICENSE Update LICENSE Jan 30, 2019
README.md Update README.md Mar 9, 2019
bang.js
config.js Show status bar if pattern not found Dec 15, 2018
find.js Search on keys, not paths Dec 15, 2018
fx.js Set cursor to found pattern line Nov 6, 2019
index.js Update usage Nov 6, 2019
package.json Update after bump hook Nov 6, 2019
print.js Fix style on search cancel Dec 15, 2018
reduce.js Add better detection of functions in reduce Dec 7, 2018
stream.js Catch stream errors gracefully Apr 3, 2019
test.js Fix bug in stream processor Feb 25, 2019

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 πŸŽ‰
  • Themes support 🎨
  • Streaming support 🌊
  • Bash completion

Install

$ npm install -g fx

Or via Homebrew

$ brew install fx

Or download standalone binary from releases page.

Did you like fx? Buy me a beer 🍺 or send come β‚Ώ

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 .

Stream JSON into fx.

$ kubectl logs ... -f | fx .message

Apply fx to a few JSON files.

$ cat *.json | fx .length
3
4

And try this:

$ fx --life

Documentation

See full documentation.

Links

Related

License

MIT

You can’t perform that action at this time.