Skip to content

Instantly share code, notes, and snippets.

@luk-
Last active December 21, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luk-/6370833 to your computer and use it in GitHub Desktop.
Save luk-/6370833 to your computer and use it in GitHub Desktop.
comma first json stringify via dominictarr
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