Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yaauie
Last active August 12, 2016 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaauie/b6a85e54ed618d02f3644fb9c2031181 to your computer and use it in GitHub Desktop.
Save yaauie/b6a85e54ed618d02f3644fb9c2031181 to your computer and use it in GitHub Desktop.
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