sfcode: semver-intersect <a href="https://www.npmjs.com/package/semver-intersect"><img src="https://img.shields.io/npm/v/semver-intersect.svg" alt="npm"/></a> <a href="https://travis-ci.org/snyamathi/semver-intersect"><img src="https://travis-ci.org/snyamathi/semver-intersect.svg?branch=master" alt="Build Status"/></a> <a href="https://david-dm.org/snyamathi/semver-intersect"><img src="https://david-dm.org/snyamathi/semver-intersect.svg" alt="David"/></a> <a href="https://npm-stat.com/charts.html?package=semver-intersect"><img src="https://img.shields.io/npm/dm/semver-intersect.svg" alt="Downloads"/></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/snyamathi/semver-intersect.svg" alt="Greenkeeper badge"/></a>

sfcode An Online Competing and Development Environment

semver-intersect

Get the intersection of multiple semver ranges

const { intersect } = require('semver-intersect');
// ^4.1.0
intersect('^4.0.0', '^4.1.0');
// ~4.3.0
intersect('^4.0.0', '~4.3.0');
// ~4.3.89
intersect('^4.0.0', '~4.3.89', '~4.3.24', '~4.3.63');
// throws "Range >=4.5.0 is not compatible with <4.4.0"
intersect('^4.0.0', '~4.3.0', '^4.5.0')