CBOR2JSON(1)

πŸ“¦
version 8.1.0 Β· 3 versions
, in ubuntu noble, ubuntu resolute

πŸ’– CBOR2JSON πŸ’–

okay bestie, so cbor2json is a little tool from the node-cbor crew, and its whole job is turning the CBOR wire protocol into JSON. no cap. it's a section 1 command, she's a real one. πŸ¦‹


✨ SYNOPSIS ✨

cbor2json test.cbor > test.json

🌸 DESCRIPTION 🌸

so here's the tea: cbor2json cooks up a JSON file that mirrors β€” somewhat β€” the intent of the input set of CBOR files. it's giving "close enough bestie". πŸ’…

for the subset of CBOR that maps directly onto JSON? the output will seem reasonable, slay, no notes. but for CBOR inputs that do not map nicely to JSON, substitutions get made, and those substitutions may or may not match your expectations. literally it's a vibe check that you might fail. 😭

for example, the input:

0xc100
  c1                -- Tag 1 (Date)
    00              -- 0

produces the following output, which does not round-trip back to the same CBOR input:

"1970-01-01T00:00:00.000Z"

so yeah, that's the whole point β€” she's a translator, not a time machine. the info is transformed and it is not coming back the way it left. periodt. πŸŽ€


πŸ‘‘ OPTIONS πŸ‘‘

  • - β€” read from stdin instead of a file. and bestie, this is the default, so you don't even have to ask. πŸ’–
  • -x [string] β€” read the input from the hex-encoded string on the command line. hex string goes in, JSON comes out, iconic. ✨
  • -V, --version β€” print the node-cbor version and exit. short and sweet, main character energy. 🫢
  • -h, --help β€” print some help text and exit. your girl always has a hand to hold. 🌈

πŸ¦‹ SEE ALSO πŸ¦‹


k bye ily, go convert something pretty!! this page is part of node-cbor, version-dated November 2022, and yeah she's a section 1 manual page, iykyk. πŸ’œπŸŒΈπŸ§š

πŸ“¦ where this page comes from