How can I beautify JSON programmatically? [duplicate]

Do you know of any “JSON Beautifier” for JavaScript?

From

{"name":"Steve","surname":"Jobs","company":"Apple"}

To

{
  "name" : "Steve",
  "surname" : "Jobs",
  "company" : "Apple"
}

Example

some_magic(jsonObj); // return beautified JSON

1 Answer
1

Leave a Comment