JSON.stringify with indent

let pretty_json = JSON.stringify({foo: 1, bar: 2}, null, 4)
console.log(pretty_json)