thedesk/node_modules/sort-keys-length
2018-01-28 21:22:43 +09:00
..
index.js TheDesk 2018-01-28 21:22:43 +09:00
LICENSE.md TheDesk 2018-01-28 21:22:43 +09:00
package.json TheDesk 2018-01-28 21:22:43 +09:00
README.md TheDesk 2018-01-28 21:22:43 +09:00

sort-keys-length Build Status

Sort object keys by length

Install

$ npm install --save sort-keys-length

Usage

var sortKeysLength = require('sort-keys-length');

sortKeysLength.asc({ ab: 'x', a: 'y', abc: 'z' });
//=> { a: 'y', ab: 'x', abc: 'z' }

sortKeysLength.desc({ ab: 'x', a: 'y', abc: 'z' });
//=> { abc: 'z', ab: 'x', a: 'y' }

API

.asc

Ascending sort.

.desc

Descending sort.

License

MIT © Kevin Mårtensson