sort-keys-length
Sort objecy keys by length
Last updated 10 years ago by kevva .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install sort-keys-length 
SYNC missed versions from official npm registry.

sort-keys-length Build Status

Sort object keys by length

Install

$ npm install sort-keys-length

Usage

const 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

sortKeysLength.asc(object, [options])

Ascending sort.

sortKeysLength.desc(object, [options])

Descending sort.

object

Type: Object

Object to sort.

options

Type: Object

deep

Type: boolean
Default: false

Recursively sort keys.

License

MIT © Kevin Mårtensson

Current Tags

  • 2.0.0                                ...           latest (7 years ago)

3 Versions

  • 2.0.0                                ...           7 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 7
Today 1
This Week 1
This Month 4
Last Day 0
Last Week 3
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE