Prettify JSON

Format JSON with proper indentation for improved readability and debugging.

Code

Utilities
echo "$jsonStr" | jq --indent "$indent" '.'

Parameters

JSON string to format.

Number of spaces for indentation.

Server

More Bash Snippets