https://github.com/martijnhoekstra/semver4s
semver handling for scala
https://github.com/martijnhoekstra/semver4s
semver semver-parser semver-range
Last synced: 5 months ago
JSON representation
semver handling for scala
- Host: GitHub
- URL: https://github.com/martijnhoekstra/semver4s
- Owner: martijnhoekstra
- License: lgpl-3.0
- Created: 2021-01-18T13:18:03.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T10:33:27.000Z (over 2 years ago)
- Last Synced: 2023-10-18T18:43:29.163Z (over 2 years ago)
- Topics: semver, semver-parser, semver-range
- Language: Scala
- Homepage:
- Size: 265 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://javadoc.io/doc/com.heroestools/semver4s_2.13)
## Semver4s
Parse SemVer, NPM-style SemVer ranges, and check whether some version matches
some range.
## Features
Parsers for semver:
```scala
import semver4s._
for {
version <- parseVersion("1.2.3")
matcher <- parseMatcher("~1.2")
} yield matcher.matches(version)
```
Short unsafe versions are available too, which are convenient for for example sbt files
```scala
import semver4s.unsafe._
"1.2.3".satisfies(">=1.2 <2")
```
Support for literal versions and matchers with the `v` and `m` interpolator, checked at compile-time
```scala
import semver4s.Literal._
m"~1.2".matches(v"1.2.3")
```
Supports all npm version ranges as matchers
Odds and end include getting upper and lower bounds for matchers and incrementing versions