Compare if two semver version range levels are the same. The world is complex, sometimes dependencies rely on others to have the same version level. For example Spectron expects Electron to have the same minor version. Testing if these two modules have the same minor version makes this implicit relation explicit, getting them in harmony.
The module is smart enough to notice a range is too wide to compare on certain levels. For example comparing the minor level on
^1.2.3 is impossible since the installed version can go up to
This module is small and simple with the downside being it only supports semver ranges with three defined numbers. This is a range you get by default when installing a module with the npm CLI.
npm install semver-level-harmony --save-dev
Example testing Spectron and Electron minor version:
const assert = ;const semverLevelHarmony = ;const electron spectron = devDependencies;assert;
semverLevelHarmony(level, versionRange, versionRange)
Version semver level:
The version semver range.