Tiny helper function for exploring any JSON data in babashka REPL
any_json_outputting_command | json2bb --repl
e.g.,
curl -s "https://api.thedogapi.com/v1/breeds" | json2bb --repl
once in the REPL, parsed EDN will be readily available in #'user/data
, you can start exploring it:
(->> data count)
(->> data (map keys) set)
;; etc.
Also, you can instead use --nrepl-server
option, connect to localhost:1667 from your editor and explore data that way.
If you simply want to convert JSON to EDN to print it out or pipe it further:
curl -s "https://api.thedogapi.com/v1/breeds" | json2bb --edn
Download it locally and:
echo 'source /path/to/json2bb.sh' >> ~/.zshrc
chmod +x json2bb.sh
ln -s /path/to/json2bb.sh ~/bin/json2bb