ls

length-sort

Sort an array of strings by length

Showing:

Popularity

Downloads/wk

7

GitHub Stars

5

Maintenance

Last Commit

4yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

length-sort Build Status

Sort an array of strings by length

Install

$ npm install length-sort

Usage

const lengthSort = require('length-sort');

['ab', 'a', 1234, 'abc'].sort(lengthSort.asc);
//=> ['a', 'ab', 'abc', 1234]

['ab', 'a', 1234, 'abc'].sort(lengthSort.desc);
//=> [1234, 'abc', 'ab', 'a']

API

lengthSort.asc

Ascending sort.

lengthSort.desc

Descending sort.

License

MIT © Kevin Mårtensson

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100