vc

version_compare

simple tool to compare version strings

Showing:

Popularity

Downloads/wk

244

GitHub Stars

12

Maintenance

Last Commit

6yrs ago

Contributors

2

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

version_compare Build Status

===============

simple tool to compare version strings

####Install npm

npm install version_compare --save

bower

bower install version_compare --save

####Node

vc = require('./version_compare')
vc.matches('1.0', '1.1') ==> false
vc.matches('1.0', '1.0') ==> true
vc.compare('1.0', '1.1') ==> -1
vc.gt('1.0', '1.1') ==> false
vc.gte('1.0', '1.1') ==> false
vc.lt('1.0', '1.1') ==> true
vc.lte('1.0', '1.1') ==> true

####Browser

<script src="bower_components/version_compare/version_compare.js"></script>
<script>
VersionCompare.matches('1.0', '1.1') ==> false
VersionCompare.matches('1.0', '1.0') ==> true
VersionCompare.compare('1.0', '1.1') ==> -1
VersionCompare.gt('1.0', '1.1') ==> false
VersionCompare.gte('1.0', '1.1') ==> false
VersionCompare.lt('1.0', '1.1') ==> true
VersionCompare.lte('1.0', '1.1') ==> true
</script>

###Credit: This repo is based off of source found here: [http://stackoverflow.com/questions/6832596/how-to-compare-software-version-number-using-js-only-number].

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100