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.
var compare = require('version-comparison');
compare('v1', '1.0'); // 0
compare('1.0.1', '1'); // 1
compare('1', '2'); // -1