Skip to content

Instantly share code, notes, and snippets.

@yaauie yaauie/jsonpp
Last active Aug 12, 2016

Embed
What would you like to do?
order-preserving jsonpp
#!/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
You can’t perform that action at this time.