Skip to content

q2s2t/version-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7a2d175 · Jul 31, 2014

History

13 Commits
Jul 31, 2014
Jul 30, 2014
Jul 31, 2014
Jul 30, 2014
Jul 30, 2014
Jul 31, 2014
Jul 31, 2014
Jul 30, 2014
Jul 31, 2014
Jul 31, 2014
Jul 31, 2014

Repository files navigation

version-sort

Dependencies Status Build Status Code quality Code coverage Release

Sort an array of versions.

Usage

This module sort an array of versions. Here some exemples of valid versions:

1.1.0
1.1.4
1.1.4.469816
2.4
2.4.2
2.4.20
2.4.20alpha
2.4.20beta
2.4.20rc1
2.4.20rc2

To use it just call the module as a function.

var sort = require('version-sort');
data = [ '2.4.20', '2.4.20rc1', '1.1', '2.4.20beta1' ];
sort(data); // '1.1', '2.4.20beta1', '2.4.20rc1', '2.4.20'

Options

var results = sort(data, options);
  • ignore_stages: (default: false) Only return stables versions and ignore staged versions. [ '1.1', '1.1alpha' ] will return [ '1.1' ].

Installation

npm install --save version-sort