Search here
Example:
var obj = {x: 1, y: 2, z: 3};
console.log( JSON.stringify(obj, null, 2) ); // spacing level = 2 The above snippet will print:
{ "x": 1, "y": 2, "z": 3 }