Usage

After installing it, you may call jstr providing the Help argument to understand a bit more about its options and such:

jstr --help

You can use NO_COLOR=1 to turn off colors from the help message

This will print some examples and description to available options, but jstr is quite simple to understand, it will basically:

  1. Receive a JSON input;

    1. By simply providing the relative file path: jstr my-file.json;

    2. Or using the Input option to receive your JSON from a piped command (stdin).

  2. Apply any transformation based on the Options provided;

  3. Run the Callback Parser (if provided) passing the result from step 2;

  4. Output the data by printing it (or copy to clipboard, if you pass the Copy option).

As you can see, all options & handler are optional, making jstr quite a flexible tool.

And as usual, since jstr will by default print the result to your terminal, you can use it to create new JSON files (or whatever file type you want):

jstr ... > my-new-file.json

Last updated