Skip to content

Simple tool for pretty printing on the command line

Notifications You must be signed in to change notification settings

BirdHighway/pretty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CLI JSON Formatter

An extremely simple tool for pretty printing JSON in a shell

Usage

# after installation, you can pipe JSON:
echo '{"one": {"two": {"three": "nesting"} } }'  | pretty-json

Output:

{
  "one": {
    "two": {
      "three": "nesting"
    }
  }
}

Installation: Mac/Linux

# Note: requires node is installed
# clone this repo or copy the file "pretty-json" to your machine
git clone https://github.com/BirdHighway/pretty.git

# make the file executable
chmod +x pretty-json

# copy the file "pretty-json" to a directory in your $PATH
# some directories will require this copy command be run with sudo
cp pretty-json ~/bin

# optional: rename the command to something shorter
mv ~/bin/pretty-json ~/bin/pj

# not sure which directories are in your $PATH?
chmod u+x show-my-path.sh
./show-my-path.sh

Simple Install

# grab script with curl, save to path, modify to make executable
sudo curl --silent -o /usr/bin/pretty-json https://raw.githubusercontent.com/BirdHighway/pretty/main/pretty-json && sudo chmod +x /usr/bin/pretty-json

About

Simple tool for pretty printing on the command line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published