robert2206 8ad867f7a5 commit inicial | 8 vuotta sitten | |
---|---|---|
.. | ||
index.js | 8 vuotta sitten | |
license | 8 vuotta sitten | |
package.json | 8 vuotta sitten | |
readme.md | 8 vuotta sitten |
Get the diff type of two semver versions:
0.0.1 0.0.2
→patch
$ npm install --save semver-diff
var semverDiff = require('semver-diff');
semverDiff('1.1.1', '1.1.2');
//=> 'patch'
semverDiff('0.0.1', '1.0.0');
//=> 'major'
semverDiff('0.0.1', '0.1.0');
//=> 'minor'
semverDiff('0.0.1-foo', '0.0.1-foo.bar');
//=> 'prerelease'
semverDiff('0.1.0', '0.1.0+foo');
//=> 'build'
semverDiff('0.0.1', '0.0.1');
//=> null
semverDiff('0.0.2', '0.0.1');
//=> null
Returns the difference type between two semver versions, or null
if they're identical or the second one is lower than the first.
Possible values: 'major'
, 'minor'
, 'patch'
, 'prerelease'
, 'build'
, null
.
MIT © Sindre Sorhus