-
-
Save bitops/1313995 to your computer and use it in GitHub Desktop.
Pretty print JSON - ruby script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Put this script in a bin directory and mark it as executable. | |
# You can now pipe unformatted json files to the script and | |
# pretty printed json will come out the other end. | |
# | |
# Has no external dependencies in Ruby 1.9.x | |
# Requires the json gem in Ruby 1.8.x | |
# | |
require 'json' | |
jj JSON.parse(STDIN.read) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment