aboutsummaryrefslogtreecommitdiff
path: root/node_modules/sort-keys-length/README.md
blob: 1efe188c00afbafb5151812fba065acbbcfcd8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# sort-keys-length [![Build Status](http://img.shields.io/travis/kevva/sort-keys-length/master.svg?style=flat)](http://travis-ci.org/kevva/sort-keys-length)

> Sort object keys by length

## Install

```sh
$ npm install --save sort-keys-length
```

## Usage

```js
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](https://github.com/kevva)