Skip to content

MasterDevs/TidyJson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TidyJson Build status Chocolatey Chocolatey

Windows command line app to pretty print JSON

Installation

TidyJson can be installed with Chocolatey

choco install tidyjson.portable

Usage

Usage: tidyJson [OPTIONS]
Uses standard in and standard out if input or output not supplied

  -c, --clipboard    Read JSON from clipboard and write it back to the
                     clipboard
  -i, --inputFile    JSON input file
  -o, --output       Output file
  -v, --verbose      Include detailed information in the output

Examples:
    echo {json:'value'} | tidyJson
        Read JSON from standard input and write it to standard output

    tidyJson -c
        Read JSON from clipboard and write it back to the clipboard

    tidyJson -o myOutput.json
        Read JSON from standard input and write it to the file myOutput.json

    tidyJson -i myInput.json
        Read JSON from the file myInput.Json and write it to standard output

    tidyJson -i myInput.json -o myOutput.json
        Read JSON from the file myInput.Json and write it to the file myOutput.json

Using from Vim

I originally wrote this so I could quickly format JSON within Vim. To map TidyJson make sure it is in your path and add the following to your .vimrc:

nmap <F-12> :1,$ ! TidyJson -<cr>:set syntax=javascript<cr>

Now when you press the F-12 key, it will format the JSON in the current buffer.

Credits

TidyJson uses the following projects: