3 ms·
Also want to point out that the jq cli, brew install jq on mac will also process json by typing "cat yourfile.json | jq .” or interactively with "jq . <<< '{"ke
by daft_pink 2y ago
Also want to point out that the jq cli, brew install jq on mac will also process json by typing "cat yourfile.json | jq .” or interactively with "jq . <<< '{"key": "value”}’”
Just wanted to point this out, because often I don’t want to put my private json data into some rando website.
- Macha 2y agoAlso if you don't want `jq` installed, `python` will also do it with `cat your.json | python -m json.tool`
- latexr 2y agoPython no longer comes preinstalled with macOS. Though running any command against /usr/bin/python3 will make macOS prompt you about installing the Xcode Developer Tools (takes two clicks), which does get you Python. Anyway, jq now ships with macOS Sequoia. For older versions of macOS, using JavaScript for Automation is preinstalled and gets the job done with a bit more verbosity: osascript -l JavaScript -e 'function run(argv) { return JSON.stringify(JSON.parse(argv[0]),null,2) }' '{"key": "value"}'
- latexr 2y ago> the jq cli, brew install jq on Mac You no longer need to install it with Homebrew. jq ships with macOS Sequoia in /usr/bin.