Last active
December 21, 2015 21:49
-
-
Save luk-/6370833 to your computer and use it in GitHub Desktop.
comma first json stringify via dominictarr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.stringify(o, null, 2) | |
.split(/(,\n\s+)/) | |
.map(function (e, i) { | |
return i%2 ? '\n'+e.substring(4)+', ' : e | |
}) | |
.join('') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment