* Fix workflow * Trigger * [auto] Update compiled version * [auto] Commit modules * Push Windows changes * Fix * [auto] Update compiled version * Try removing cwd * [auto] Update compiled version * Try with path module * [auto] Update compiled version * Fix path * [auto] Update compiled version * Use raw path * [auto] Update compiled version * Other path * [auto] Update compiled version * Avoid @action/exec * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * test * [auto] Update compiled version * Try with shelljs * [auto] Update compiled version * Fix my stupidity * Copy scripts to local dir * [auto] Update compiled version * Still use path * [auto] Update compiled version * Delete entrypoint.sh * [auto] Update compiled version * Make file executable * [auto] Update compiled version * Try using bash * [auto] Update compiled version
53 lines
1.0 KiB
Markdown
53 lines
1.0 KiB
Markdown
# semver-diff [](https://travis-ci.org/sindresorhus/semver-diff)
|
|
|
|
> Get the diff type of two [semver](https://github.com/isaacs/node-semver) versions: `0.0.1 0.0.2` → `patch`
|
|
|
|
|
|
## Install
|
|
|
|
```sh
|
|
$ npm install --save semver-diff
|
|
```
|
|
|
|
|
|
## Usage
|
|
|
|
```js
|
|
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
|
|
```
|
|
|
|
|
|
## API
|
|
|
|
### semverDiff(versionA, versionB)
|
|
|
|
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`.
|
|
|
|
|
|
## License
|
|
|
|
MIT © [Sindre Sorhus](http://sindresorhus.com)
|