Skip to content

Instantly share code, notes, and snippets.

@brendano brendano/jsontidy
Created Aug 12, 2008

Embed
What would you like to do?
jsontidy
#!/usr/bin/env ruby
# jsontidy
# POSSIBLE USAGE
# [[Shell]] cat data.json | jsontidy
# [[TextMate]] Cmd-A Cmd-Opt-R jsontidy
# [[Vim] :%!jsontidy
# alternate implementation: python -m simplejson.tool
require 'rubygems'
require 'json'
x = JSON.parse STDIN.read
puts JSON.pretty_generate(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.