alphabetically-sort-json

Alphabetically sort an object specified in the 'jsonInPath' property. Traverses recursively the object and uses String.prototype.localeCompare() to compare each pair of strings.

Usage no npm install needed!

<script type="module">
  import alphabeticallySortJson from 'https://cdn.skypack.dev/alphabetically-sort-json';
</script>

README

Alphabetically sort an object specified in the 'jsonInPath' property. If the object is inside msg.testObj, then jsonInPath should be 'testObj'.