Minifying JSON with jq
This post's featured URL for sharing metadata is https://www.jvt.me/img/profile.jpg.
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 --indent:
% jq --indent 0 . < a.json
{"key":[123,456],"key2":"value"}