# parse

Version and range parsing, with both strict and permissive variants.

`parseVersion(input)` accepts the common loose forms (leading `v`, missing patch, etc.) and returns a [`ParseVersionResult`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-ParseVersionResult); [`parseVersionStrict`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-parseVersionStrict) rejects anything that isn't fully spec-compliant. [`coerceVersion`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-coerceVersion) is the most permissive option: it pulls a usable [`SemVer`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-SemVer) out of arbitrary inputs like `"v1"`, `"1.2"`, or `"1.2.3.4"` for use cases where semver-ish input must be normalized. [`parseRange`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-parseRange) and [`parseRangeStrict`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-parseRangeStrict) are the equivalents for npm-style range syntax (`^1.2.0`, `~1.2`, `>=1.0.0 <2.0.0`, ...) and return a [`ParseRangeResult`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/#api-ParseRangeResult) carrying either the parsed [`Range`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-Range) or a structured failure reason.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse/
This file: https://www.hyperfrontend.dev/docs/libraries/versioning/semver/parse.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
