compare-semver
Compare semver versions to many other semver versions
Last updated 11 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install compare-semver 
SYNC missed versions from official npm registry.

compare-semver

Compare semver versions to many other semver versions.

Install

npm install compare-semver --save

Usage

var compare = require('compare-semver');
var versions = [
  '0.0.11',
  '0.1.0',
  '0.2.0',
  '0.1.11'
];

var maxSemver = compare.max(versions);

Methods

max(versions)

Returns the greatest version from the list of versions

  • versions - an array of semantic versions

min(versions)

Returns the smallest version from the list of versions

  • versions - an array of semantic versions

gt(version, versions)

Compare that single version is greater than all versions in the list

  • version - the version to compare
  • versions - an array of semantic versions

lt(version, versions)

Compare that single version is less than all versions in the list

  • version - the version to compare
  • versions - an array of semantic versions

unique(version, versions)

Is the given version unique compared to the list of versions

  • version - the version to compare
  • versions - an array of semantic versions

Run Tests

npm install
npm test

Current Tags

  • 1.1.0                                ...           latest (11 years ago)

9 Versions

  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
  • 0.3.3                                ...           12 years ago
  • 0.3.2                                ...           12 years ago
  • 0.3.1                                ...           12 years ago
  • 0.3.0                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 9
Today 1
This Week 9
This Month 9
Last Day 1
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE