# parse

Parsers for repository URLs and `package.json` repository declarations.

[`parseRepositoryUrl`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-parseRepositoryUrl) recognizes the common URL shapes (HTTPS, SSH, `git+https://`, scoped paths) and returns a [`ParsedRepository`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-ParsedRepository) carrying platform, owner, and repo. [`createRepositoryConfigFromUrl`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-createRepositoryConfigFromUrl) is the convenience wrapper that goes straight from a URL to a usable [`RepositoryConfig`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/models/#api-RepositoryConfig). [`inferRepositoryFromPackageJson`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-inferRepositoryFromPackageJson) and [`inferRepositoryFromPackageJsonObject`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-inferRepositoryFromPackageJsonObject) read the [`repository`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-PackageJsonForRepository-prop-repository) field of a `package.json` (whether string or object form) and produce a config; [`extractRepositoryUrl`](https://www.hyperfrontend.dev/docs/libraries/versioning/repository/parse/#api-extractRepositoryUrl) is the lower-level helper that just returns the URL string.

---

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