Manikandan Manikandan - 4 months ago 14
JSON Question

What does jq '.' does?

How the jq '.' parsing the json and displaying ?

curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.'


I see the json is parsed and diplayed correctly


What is the implementation behind " xxxx | jq '.' "


How can i understand that ?

Answer

From the documentation:

.

The absolute simplest (and least interesting) filter is .. This is a filter that takes its input and produces it unchanged as output.

Since jq by default pretty-prints all output, this trivial program can be a useful way of formatting JSON output from, say, curl.

Comments