version-comparison

Compare two version strings.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
version-comparison
182.1.16 years ago8 years agoMinified + gzip package size for version-comparison in KB

Readme

Compare Versions
Build Status Coverage Status
This utility will compare two version strings to determine which is larger or if the strings are equivalent.
Note: this utility makes a best effort at comparing sane version strings but is not meant to be a catchall.

Usage

var compare = require('version-comparison');
compare('v1', '1.0');  //  0
compare('1.0.1', '1'); //  1
compare('1', '2');     // -1