v/vlib/semver
jeffmikels a60b381d5e
docs: adding skeleton README.md files for all vlib modules (#13034)
2022-01-05 18:06:08 +02:00
..
LICENSE.md
README.md docs: adding skeleton README.md files for all vlib modules (#13034) 2022-01-05 18:06:08 +02:00
compare.v fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
parse.v ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
range.v tests: fix `-cstrict` self compilation on m0 with clang 2021-06-07 18:23:18 +03:00
semver.v semver: add a Version.str() method with unit tests (#12779) 2021-12-09 21:25:55 +02:00
semver_test.v semver: add a Version.str() method with unit tests (#12779) 2021-12-09 21:25:55 +02:00
util.v
v.mod

README.md

Description:

semver is a library for processing versions, that use the semver format.

Examples:

import semver

fn main() {
	ver1 := semver.from('1.2.4') or {
		println('Invalid version')
		return
	}
	ver2 := semver.from('2.3.4') or {
		println('Invalid version')
		return
	}
	println(ver1.gt(ver2))
	println(ver2.gt(ver1))
	println(ver1.satisfies('>=1.1.0 <2.0.0'))
	println(ver2.satisfies('>=1.1.0 <2.0.0'))
	println(ver2.satisfies('>=1.1.0 <2.0.0 || >2.2.0'))
}
false
true
true
false
true

For more details see semver.v file.