#lang en <> = jq: The Command-line JSON processor = = Usage = == Beautify Json == When a curl or other application returns a minified JSON, beautifying it makes it a lot more easy to read. {{{ curl | jq '.' }}} {{{#!highlight json # Example: > curl -s http://dummy.restapiexample.com/api/v1/employees {"status":"success","data":[{"id":"1","employee_name":"Tiger Nixon","employee_salary":"320800","employee_age":"61","profile_image":""},{"id":"2","employee_name":"Garrett Winters","employee_salary":"170750","employee_age":"63","profile_image":""},.... > curl -s http://dummy.restapiexample.com/api/v1/employees | jq '.' { "status": "success", "data": [ { "id": "1", "employee_name": "Tiger Nixon", "employee_salary": "320800", "employee_age": "61", "profile_image": "" }, { "id": "2", "employee_name": "Garrett Winters", "employee_salary": "170750", "employee_age": "63", "profile_image": "" },... }}} == Limiting depth == With large unknown datasets, it might be interesting to only see the first few 'levels' of the response The amount of `[]?` determains how many levels wil be shown {{{ curl | jq 'del(.[]?[]?[]?[]?)' }}} {{{#!highlight json # Example: > curl -s http://dummy.restapiexample.com/api/v1/employees | jq 'del(.[]?[]?)' { "status": "success", "data": [] } }}}