Skip to content
Alphanumeric sorting algorithm
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Optimize result array Oct 3, 2015
.editorconfig Initial Sep 27, 2015
.eslintrc
.gitignore Initial Sep 27, 2015
.travis.yml fix travis Sep 27, 2015
LICENSE
README.md Initial Sep 27, 2015
package.json 1.0.2 Oct 3, 2015
test.js Initial Sep 27, 2015

README.md

alphanum-sort

Build Status

Alphanumeric sorting algorithm

Install

With npm do:

npm i alphanum-sort -S

Example

var sort = require('alphanum-sort');

var result = sort(['item20', 'item19', 'item1', 'item10', 'item2']);
// ['item1', 'item2', 'item10', 'item19', 'item20']

API

alphanumSort(array, options)

options

insensitive

Type: Boolean Default: false

Compares items case insensitively

sign

Type: Boolean Default: false

Allows + and - characters before numbers

License

MIT © Bogdan Chadkin

You can’t perform that action at this time.