Last active
August 12, 2016 01:22
-
-
Save yaauie/b6a85e54ed618d02f3644fb9c2031181 to your computer and use it in GitHub Desktop.
order-preserving jsonpp
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 | |
# encoding: utf-8 | |
require 'json' | |
begin | |
$stdout.puts(JSON.pretty_generate(JSON.load($stdin.read))) | |
rescue JSON::ParserError => e | |
$stderr.puts(e.message) | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment