semver-closest
Find the closest matching semver from an array of semver versions
Last updated 7 years ago by pastelsky .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install semver-closest 
SYNC missed versions from official npm registry.

Travis npm

Find the closest semver formatted version (<major>.<minor>.<patch>) from a list of semver formatted versions

Examples

const closestSemver = require('semver-closest')

closestSemver('1.2.0', ['1.1.9', '1.2.0', '1.2.1'])
// returns '1.2.0'

closestSemver('1.2.0', ['1.1.9', '1.3.1', '1.2.1'])
// returns '1.1.9'

closestSemver('2.2.0', ['4.1.9', '10.3.1', '3.2.1'])
// returns '3.2.1'

Current Tags

  • 0.1.2                                ...           latest (7 years ago)

3 Versions

  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE