semver-diff
获取两个版本的diff类型: 0.0.1 0.0.2 → patch
安装
$ npm install semver-diff
用法
import semverDiff from 'semver-diff' ;
semverDiff ( '1.1.1' , '1.1.2' ) ;
//=> 'patch'
semverDiff ( '1.1.1-foo' , '1.1.2' ) ;
//=> 'prepatch'
semverDiff ( '0.0.1' , '1.0.0' ) ;
//=> 'major'
semverDiff ( '0.0.1-foo' , '1.0.0' ) ;
//=> 'premajor'
semverDiff ( '0.0.1' , '0.1.0' ) ;
//=> 'minor'
semverDiff ( '0.0.1-foo' ,
1