Utilities for npm version string manipulation.
Helpers for parsing, comparing, and formatting npm version strings
that go beyond what Elixir's Version module handles.
Summary
Functions
Increment the major version (resets minor and patch to 0).
Increment the minor version (resets patch to 0).
Increment the patch version.
Compare two version strings.
Check if version a is greater than version b.
Get the latest (highest) version from a list.
Check if version a is less than version b.
Get the major version number from a version string.
Get the minor version number from a version string.
Parse a version string into {major, minor, patch} tuple.
Check if a version is a prerelease (has a pre tag).
Sort a list of version strings.
Functions
Increment the major version (resets minor and patch to 0).
Increment the minor version (resets patch to 0).
Increment the patch version.
Compare two version strings.
Returns :gt, :eq, or :lt.
Check if version a is greater than version b.
Get the latest (highest) version from a list.
Check if version a is less than version b.
@spec major(String.t()) :: non_neg_integer() | :error
Get the major version number from a version string.
@spec minor(String.t()) :: non_neg_integer() | :error
Get the minor version number from a version string.
@spec parse_triple(String.t()) :: {:ok, {non_neg_integer(), non_neg_integer(), non_neg_integer()}} | :error
Parse a version string into {major, minor, patch} tuple.
Returns :error for invalid versions.
Check if a version is a prerelease (has a pre tag).
Sort a list of version strings.