v/vlib/semver
2025-01-16 16:36:12 +02:00
..
compare.v all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
LICENSE.md all: add #pkgconfig directive using the new vlib modules (#6673) 2020-10-26 18:05:18 +01:00
parse.v fmt: remove the prefixed module name of const names, that are in the same module (related #22183) (#22185) 2024-09-10 11:25:56 +03:00
range.v fmt: remove the prefixed module name of const names, that are in the same module (related #22183) (#22185) 2024-09-10 11:25:56 +03:00
README.md all: remove ancient deprecations (#23479) 2025-01-16 16:36:12 +02:00
semver.v all: remove ancient deprecations (#23479) 2025-01-16 16:36:12 +02:00
semver_test.v all: unwrap const() blocks 2023-11-25 10:02:51 +03:00
util.v all: update attributes to use new syntax 2023-11-15 16:16:01 +11:00
v.mod V 0.4.9 2024-12-22 03:48:41 +03:00

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 > ver2)
	println(ver2 > 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.