cq/src/json-to-cbor.cr

11 lines
192 B
Crystal
Raw Permalink Normal View History

require "cbor"
require "json"
if ARGV.size >= 1
puts "usage: json-to-cbor < file.json > file.cbor"
exit 0
end
json_content = JSON.parse STDIN.gets_to_end
STDOUT.write json_content.to_cbor