Need help with fx?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

antonmedv
10.0K Stars 323 Forks MIT License 247 Commits 27 Opened issues

Description

Command-line tool and terminal JSON viewer 🔥

Services available

!
?

Need anything else?

Contributors list

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

bash
brew install fx
Or download standalone binary from releases
bash
bash 

Usage

Start interactive mode without passing any arguments.

bash
$ curl ... | fx

Or by passing filename as first argument.

bash
$ fx data.json

Pass a few JSON files.

bash
cat foo.json bar.json baz.json | fx .message

Use full power of JavaScript.

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

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

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

Update JSON using spread operator.

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

Extract values from maps.

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

Print formatted JSON to stdout.

bash
$ curl ... | fx .

Pipe JSON logs stream into fx.

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

And try this:

bash
$ fx --life

Documentation

See full documentation.

Links

Related

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.