I JSON.stringify a json object by
JSON.stringify
result = JSON.stringify(message, my_json, 2)
The 2 in the argument above is su
2
Full disclosure I am the author of this package but another way to output JSON or JavaScript objects in a readable way complete with being able skip parts, collapse them, etc. is nodedump, https://github.com/ragamufin/nodedump
nodedump