https://github.com/gulpjs/semver-greatest-satisfied-range
Find the greatest satisfied semver range from an array of ranges.
https://github.com/gulpjs/semver-greatest-satisfied-range
Last synced: 9 months ago
JSON representation
Find the greatest satisfied semver range from an array of ranges.
- Host: GitHub
- URL: https://github.com/gulpjs/semver-greatest-satisfied-range
- Owner: gulpjs
- License: mit
- Created: 2015-01-05T09:37:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-31T20:25:11.000Z (over 4 years ago)
- Last Synced: 2025-10-08T18:47:20.952Z (9 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 9
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# semver-greatest-satisfied-range
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Find the greatest satisfied semver range from an array of ranges.
## Usage
```js
var findRange = require('semver-greatest-satisfied-range');
var range = findRange('1.1.0', ['^1.0.0', '^1.1.0', '^1.2.0']);
// range === '^1.1.0'
```
## API
### `findRange(version, rangeArray)`
Takes a version and array of ranges, returns the greatest satisfied range. Range support is defined by [sver][range-support].
## License
MIT
[downloads-image]: https://img.shields.io/npm/dm/semver-greatest-satisfied-range.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/semver-greatest-satisfied-range
[npm-image]: https://img.shields.io/npm/v/semver-greatest-satisfied-range.svg?style=flat-square
[ci-url]: https://github.com/gulpjs/semver-greatest-satisfied-range/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/semver-greatest-satisfied-range/dev?style=flat-square
[coveralls-url]: https://coveralls.io/r/gulpjs/semver-greatest-satisfied-range
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/semver-greatest-satisfied-range/master.svg?style=flat-square
[range-support]: https://github.com/guybedford/sver#range-support