Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Philipp Partosch 46a936d7de added all files to project 2 years ago
..
example added all files to project 2 years ago
test added all files to project 2 years ago
.travis.yml added all files to project 2 years ago
LICENSE added all files to project 2 years ago
index.js added all files to project 2 years ago
package.json added all files to project 2 years ago
readme.markdown added all files to project 2 years ago

readme.markdown

semver-compare

compare two semver version strings, returning -1, 0, or 1

The return value can be fed straight into [].sort.

build status

example

var cmp = require('semver-compare');
var versions = [
    '1.2.3',
    '4.11.6',
    '4.2.0',
    '1.5.19',
    '1.5.5',
    '4.1.3',
    '2.3.1',
    '10.5.5',
    '11.3.0'
];
console.log(versions.sort(cmp).join('\n'));

prints:

1.2.3
1.5.5
1.5.19
2.3.1
4.1.3
4.2.0
4.11.6
10.5.5
11.3.0

whereas the default lexicographic sort (versions.sort()) would be:

1.2.3
1.5.19
1.5.5
10.5.5
11.3.0
2.3.1
4.1.3
4.11.6
4.2.0

methods

var cmp = require('semver-compare')

cmp(a, b)

If the semver string a is greater than b, return 1. If the semver string b is greater than a, return -1. If a equals b, return 0;

install

With npm do:

npm install semver-compare

license

MIT