ghaction-upx/node_modules/sort-keys-length/README.md

36 lines
624 B
Markdown
Raw Normal View History

2020-01-17 01:36:42 -07:00
# 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)