No description
Find a file
2024-10-04 12:42:05 +01:00
.github/workflows Added GitHub Actions workflow to run tests (#7) 2023-02-26 11:38:46 +00:00
src feat: switch to parseBiggestInt for build number parsing 2024-10-04 13:15:47 +02:00
tests Add tests to cover for regression 2023-04-02 22:36:48 +02:00
.editorconfig Remove useless import, add tests task to nimble project 2016-06-22 15:45:46 +01:00
.gitignore fixes #3, refactor (#6) 2023-02-13 11:50:20 +00:00
LICENSE Added GitHub Actions workflow to run tests (#7) 2023-02-26 11:38:46 +00:00
README.md Added GitHub Actions workflow to run tests (#7) 2023-02-26 11:38:46 +00:00
semver.nimble Update semver.nimble 2024-10-04 12:42:05 +01:00

semver.nim

Semantic versioning parser for Nim.

Allows the parsing of version strings into objects and the comparing of version objects.

Installation

nimble install semver

Or add the following to your .nimble file:

# Dependencies

requires "semver >= 1.2.0"

Usage

import semver

let version = newVersion(1, 2, 3)
let usersVersion = parseVersion("v1.2.4-alpha") # Version(major: 1, minor: 2, patch: 4, build: "alpha", metadata: "")

check usersVersion > version # true
check usersVersion == version # false

When parsing versions, the module will automatically ignore any proceeding "=v" or "v", allowing it to work with user submitted versions for packages.