legoboy0215 / TidyJson

Windows command line app to pretty print json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 -f 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 -f 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:

About

Windows command line app to pretty print json

License:MIT License


Languages

Language:C# 68.4%Language:PowerShell 29.2%Language:Batchfile 2.3%