Command-line tool and bash library that creates JSON
json.bash's one thing is to get shell-native data (environment variables, files, program output) to somewhere else, using JSON encapsulate it robustly. Creating JSON from the command line or a shell script can be useful when: - you need some ad-hoc JSON to interact with a JSON-consuming application, - you need to bundle up some data to share or move elsewhere. JSON can a good alternative to base64-encoding or a file archive. It does no transformation or filtering itself, instead it pulls data from things you already know how to use, like files, command-line arguments, environment variables, shell pipelines and shell scripts. It glues together data from these sources, giving it enough structure to make the data easy to consume reliably in downstream programs. It's something like a reverse tee — it pulls together data sources, using JSON to represent the aggregation. It's not an alternative to to data-processing tools like jq, rather it helps assemble JSON to send into JSON-consuming tools like jq.
json.bash's one thing is to get shell-native data (environment variables, files, program output) to somewhere else, using JSON encapsulate it robustly. Creating JSON from the command line or a shell script can be useful when: - you need some ad-hoc JSON to interact with a JSON-consuming application, - you need to bundle up some data to share or move elsewhere. JSON can a good alternative to base64-encoding or a file archive. It does no transformation or filtering itself, instead it pulls data from things you already know how to use, like files, command-line arguments, environment variables, shell pipelines and shell scripts. It glues together data from these sources, giving it enough structure to make the data easy to consume reliably in downstream programs. It's something like a reverse tee — it pulls together data sources, using JSON to represent the aggregation. It's not an alternative to to data-processing tools like jq, rather it helps assemble JSON to send into JSON-consuming tools like jq.
To install json.bash, run the following command in macOS terminal (Applications->Utilities->Terminal)
sudo port install json.bash
To see what files were installed by json.bash, run:
port contents json.bash
To later upgrade json.bash, run:
sudo port selfupdate && sudo port upgrade json.bash
Reporting an issue on MacPorts Trac
The MacPorts Project uses a system called Trac to file tickets to report bugs and enhancement requests.
Though anyone may search Trac for tickets, you must have a GitHub account in order to login to Trac to create tickets.