• Creates a new Version 0.0.0.

    Returns SemVer

  • Creates a new version.

    Parameters

    • Optionalmajor: number

      major version part (1 in 1.2.3)

    • Optionalminor: number

      minor version part (2 in 1.2.3)

    • Optionalpatch: number

      patch version part (3 in 1.2.3)

    • Optionalhotfix: number

      hotfix version part (4 in 1.2.3.4)

    • Optionalprerelease: readonly string[]

      pre-release part (SNAPSHOT in 1.2.3-SNAPSHOT)

    • Optionalbuild: string

      build part (20240123 in 1.2.3+20240123)

    Returns SemVer

  • Parses a version string to a version.

    Parameters

    • OptionalversionString: string

      version string, e.g. 1.2.3

    • OptionalignoreBuild: boolean

      ignore build part in version, for example would create a version without 20240123 from string 1.2.3+20240123

    Returns SemVer

Properties

Properties

compare: (a: SemVer, b: SemVer) => number

Compares two versions.

Type declaration

equals: (a: SemVer, b: SemVer) => boolean

Checks if two versions are equal.