Skip to content

Commit

Permalink
Add npm badge and code example
Browse files Browse the repository at this point in the history
  • Loading branch information
snyamathi authored Jun 13, 2017
1 parent 1256892 commit c45c1e6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# semver-intersect [![Build Status](https://travis-ci.org/snyamathi/semver-intersect.svg?branch=master)](https://travis-ci.org/snyamathi/semver-intersect)
# semver-intersect [![Build Status](https://travis-ci.org/snyamathi/semver-intersect.svg?branch=master)](https://travis-ci.org/snyamathi/semver-intersect) [![npm](https://img.shields.io/npm/v/semver-intersect.svg)](https://www.npmjs.com/package/semver-intersect)
Get the intersection of multiple semver ranges

```js
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')
```

0 comments on commit c45c1e6

Please sign in to comment.