CBOR2JSON(1)
π 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
- ubuntu noble: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- ubuntu resolute: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms