Sha256: 022d8551f77801964afa3c8ce8ae7eca5439b75b3881aa87c6c3b0b0fa256d4c

Contents?: true

Size: 1 KB

Versions: 62

Compression:

Stored size: 1 KB

Contents

# semver-diff [![Build Status](https://travis-ci.org/sindresorhus/semver-diff.svg?branch=master)](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)

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.6 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.8 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.7 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.6 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.5 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md
trusty-festivity-extension-2.5.4 node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/readme.md