Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[JavaScript] Easy JSON beautifier - with optionally using comma-first syntax. can handle any complexity of object/array combinations.
JSON.stringify(YOUR_OBJECT, null, 2)
.replace(/,\n /gm, "\n ,").replace(/ *(,(\ +))/gm, "$2,") //comma-first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.