Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wankdanker/sortkeys
Sort the keys of a Javascript Object
https://github.com/wankdanker/sortkeys
Last synced: 14 days ago
JSON representation
Sort the keys of a Javascript Object
- Host: GitHub
- URL: https://github.com/wankdanker/sortkeys
- Owner: wankdanker
- Created: 2012-06-26T20:26:35.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-06-16T16:56:29.000Z (over 9 years ago)
- Last Synced: 2024-04-25T12:03:00.277Z (9 months ago)
- Language: JavaScript
- Size: 94.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sortkeys
--------[![Build Status](https://travis-ci.org/wankdanker/sortkeys.svg)](https://travis-ci.org/wankdanker/sortkeys)
This function recursively sorts the keys of an object according to `Object.keys(obj).sort().`
An example should explain it:
```javascript
var sortkeys = require('sortkeys');
var objToSort = {
d : "is for dog"
, c : "is for cat"
, f : "is for fig"
, a : "is for ant"
};console.log(sortkeys(objToSort));
/*
{ a: 'is for ant',
c: 'is for cat',
d: 'is for dog',
f: 'is for fig' }
*/
```license
-------MIT