title: How can I beautify JSON programmatically?
body: <p>Do you know of any &quot;JSON Beautifier&quot; for JavaScript?</p>
  <p><strong>From</strong></p>
  <pre class="lang-json prettyprint-override"><code>{&quot;name&quot;:&quot;Steve&quot;,&quot;surname&quot;:&quot;Jobs&quot;,&quot;company&quot;:&quot;Apple&quot;}
  </code></pre>
  <p><strong>To</strong></p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;name&quot; : &quot;Steve&quot;,
    &quot;surname&quot; : &quot;Jobs&quot;,
    &quot;company&quot; : &quot;Apple&quot;
  }
  </code></pre>
  <p><strong>Example</strong></p>
  <pre class="lang-js prettyprint-override"><code>some_magic(jsonObj); // return beautified JSON
  </code></pre>