{"name":"semver-diff","version":"5.0.0","keywords":["semver","version","semantic","diff","difference"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"semver-diff@5.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/semver-diff#readme","bugs":{"url":"https://github.com/sindresorhus/semver-diff/issues"},"dist":{"shasum":"62a8396f44c11386c83d1e57caedc806c6c7755c","tarball":"http://registry-npm.ywwl.com/semver-diff/download/semver-diff-5.0.0.tgz","fileCount":5,"integrity":"sha512-0HbGtOm+S7T6NGQ/pxJSJipJvc4DK3FcRVMRkhsIwJDJ4Jcz5DQC1cPPzB5GhzyHjwttW878HaWQq46CkL3cqg==","signatures":[{"sig":"MEYCIQDWIFFKrZyFupiklrRoTKpfxK7ttxBeW0Z0A2hyMFKZ3gIhAIGTI9kMvt7NLlvgMBPFXRiOnBLPu4UOIwHVkh55ixCC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4862,"size":2001,"noattachment":false,"key":"/semver-diff/-/semver-diff-5.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=12"},"exports":"./index.js","funding":"https://github.com/sponsors/sindresorhus","gitHead":"4b51e395362d448d6669f787b0a96d650c38ba25","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/semver-diff.git","type":"git"},"_npmVersion":"10.9.2","description":"Get the diff type of two semver versions: 0.0.1 0.0.2 → patch","directories":{},"sideEffects":false,"_nodeVersion":"20.19.1","dependencies":{"semver":"^7.3.5"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.39.1","ava":"^3.15.0","tsd":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/semver-diff_5.0.0_1757932686885_0.9425470274113137","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Deprecated as the semver package now supports this built-in.","readme":"# semver-diff\n\n> Get the diff type of two [semver](https://github.com/npm/node-semver) versions: `0.0.1 0.0.2` → `patch`\n\n> [!NOTE]\n> Deprecated because the `semver` package now supports this built-in.\n\n## Install\n\n```sh\nnpm install semver-diff\n```\n\n## Usage\n\n```js\nimport semverDiff from 'semver-diff';\n\nsemverDiff('1.1.1', '1.1.2');\n//=> 'patch'\n\nsemverDiff('1.1.1-foo', '1.1.2');\n//=> 'prepatch'\n\nsemverDiff('0.0.1', '1.0.0');\n//=> 'major'\n\nsemverDiff('0.0.1-foo', '1.0.0');\n//=> 'premajor'\n\nsemverDiff('0.0.1', '0.1.0');\n//=> 'minor'\n\nsemverDiff('0.0.1-foo', '0.1.0');\n//=> 'preminor'\n\nsemverDiff('0.0.1-foo', '0.0.1-foo.bar');\n//=> 'prerelease'\n\nsemverDiff('0.1.0', '0.1.0+foo');\n//=> 'build'\n\nsemverDiff('0.0.1', '0.0.1');\n//=> undefined\n\nsemverDiff('0.0.2', '0.0.1');\n//=> undefined\n```\n\n## API\n\n### semverDiff(versionA, versionB)\n\nReturns the difference type between two semver versions, or `undefined` if they are identical or the second one is lower than the first.\n\nPossible values:\n\n- `'major'`,\n- `'premajor'`,\n- `'minor'`,\n- `'preminor'`,\n- `'patch'`,\n- `'prepatch'`,\n- `'prerelease'`,\n- `'build'`,\n- `undefined`\n\n## Related\n\n- [latest-semver](https://github.com/sindresorhus/latest-semver) - Get the latest stable semver version from an array of versions\n- [to-semver](https://github.com/sindresorhus/to-semver) - Get an array of valid, sorted, and cleaned semver versions from an array of strings\n- [semver-regex](https://github.com/sindresorhus/semver-regex) - Regular expression for matching semver versions\n- [semver-truncate](https://github.com/sindresorhus/semver-truncate) - Truncate a semver version: `1.2.3` → `1.2.0`\n","publish_time":1757932687075,"_cnpm_publish_time":1757932687075,"dist-tags":{"latest":"5.0.0"}}