sort-keys-length
Sort objecy keys by length
Last updated 9 years ago by kevva .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (9 years ago)

3 Versions

  • 2.0.0                                ...           9 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |