PaulJuliusMartinez / jless

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.
https://jless.io
MIT License
4.61k stars 87 forks source link

CBOR support #125

Closed pspacek closed 11 months ago

pspacek commented 1 year ago

Hello - and first of all thank you for jless - it's awesome!

I wonder if you would be open to adding CBOR format as input? It is self-descriptive in the same way as JSON is, so I think it would fit nicely into JSON and YAML family.

There are CBOR libraries for Go readily available, e.g. https://pkg.go.dev/github.com/fxamacker/cbor . Edit: https://github.com/fxamacker/cbor/releases has newer versions as well.

Thank you for considering this.

PaulJuliusMartinez commented 11 months ago

I don't believe CBOR is relevant enough to merit inclusion in jless at this time. (See Google Trends)

There seems to be at least one CBOR-to-JSON tool that you could use together with jless. You could setup the following function in your .bashrc:

# Usage:
# $ cless data.cbor          # Read a file
# $ cat data.cbor | cless    # Read the output of another command
function cless() {
  if [[ $# -eq 0 ]]; then
    cbor | jless
  else
    cbor "$1" | jless
  fi
}
spacekpe commented 11 months ago

Fair enough, thank you!