# length-sort

> Sort an array of strings by length

Latest version **2.0.0** (published 2017-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install length-sort
pnpm add length-sort
yarn add length-sort
bun add length-sort
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-07-03 |
| First published | 2015-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Kevin Mårtensson |
| Maintainers | kevva |
| Keywords | array, length, sort |

## Links

- npm: https://www.npmjs.com/package/length-sort
- Repository: https://github.com/kevva/length-sort
- Homepage: https://github.com/kevva/length-sort#readme
- Issues: https://github.com/kevva/length-sort/issues
- npm.io page: https://npm.io/package/length-sort

## Recent versions

- 2.0.0 (latest) — 2017-07-03
- 1.0.0 — 2015-01-23

## README

# length-sort [![Build Status](https://travis-ci.org/kevva/length-sort.svg?branch=master)](https://travis-ci.org/kevva/length-sort)

> Sort an array of strings by length


## Install

```
$ npm install length-sort
```


## Usage

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

---
_Source: https://npm.io/package/length-sort · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
