Minifying JSON with jq
As an improvement to my version with Python or with Ruby, with tools like jq now being widely used, how do we minify a JSON string?
Given:
{
"key": [
123,
456
],
"key2": "value"
}We can override the -c:
% jq -c . < a.json
{"key":[123,456],"key2":"value"}
(Thanks to jtheo's suggestion to simplify this from using --indent 0)
