Nondeterministic Palindrome Machine

npm

Need private packages and team management tools?Check out npm Orgs. »

length-sort

2.0.0 • Public • Published

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

install

npm i length-sort

Downloadsweekly downloads

10

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability