json2cbor 2.0.0

Convert JSON to CBOR
json2cbor-2.0.0 is not a library.

JSON2CBOR

This repo contains two really simple programs to convert JSON to CBOR and vice versa. It does the transformation using serde-transcode.

Install

  1. Install Rust.
  2. cargo install json2cbor.

Use

json2cbor and cbor2json both take the same flags & arguments

Reads/writes to stdin/stdout by default

echo '{"foo":"bar"}' | json2cbor | cbor2json
# Output: {"foo":"bar"}

Read from an input file

json2cbor in.json

Write to an output file

echo '{"foo":"bar"}' | json2cbor -o out.cbor

Read & write to files

json2cbor -o out.cbor in.json

Get help

json2cbor --help