talira

The semantic version parser npm uses, as a JavaScript library and command-line tool

open sourceISCfree

semver (node-semver) is the semantic versioner npm uses: a JavaScript implementation of the SemVer 2.0.0 specification. It parses, validates, cleans, compares, sorts and increments versions, checks whether a version satisfies a range in npm's range syntax (hyphen, X, tilde and caret ranges, with prerelease tags), finds the highest or lowest version that satisfies a range, and coerces loose strings into versions. It also works as a command-line tool.

Ways to install

Package managers

Problems it solves

  • check whether a version string satisfies a version range in JavaScript
  • compare and sort semantic version numbers in Node.js
  • bump a package version number in a release script

Features

  • Parse, validate, clean and compare versions
  • Check whether a version satisfies a range
  • Hyphen, X, tilde and caret ranges with prerelease tags
  • Find the highest or lowest version satisfying a range
  • Increment versions, including prereleases
  • Coerce loose strings into versions
  • Load single functions to keep bundles small
  • Command-line tool