brendano (owner)

Revisions

gist: 4973 Download_button fork
public
Description:
jsontidy
Public Clone URL: git://gist.github.com/4973.git
Embed All Files: show embed
jsontidy #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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)