node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »

@voxpelli/semver-set

semver-set

Set operations for semver.

Usage

intersect

Find the intersection of multiple semver ranges. This can be useful for finding a "lowest common denominator" of versions.

import { intersect } from 'semver-set';
 
// ^2.2.0
intersect('^1.1 || ^2.2 || >=5', '^2.2.0-alpha1');
 
// null
intersect('~2.2.4', '~2.3.0');