{"id":37424228,"url":"https://github.com/hyperjump-io/uri","last_synced_at":"2026-01-16T06:11:06.542Z","repository":{"id":65281220,"uuid":"588350334","full_name":"hyperjump-io/uri","owner":"hyperjump-io","description":"A small and fast library for validating, parsing, and resolving URIs (RFC 3986) and IRIs (RFC 3987).","archived":false,"fork":false,"pushed_at":"2025-09-23T23:52:23.000Z","size":43,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T06:47:39.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperjump-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-12T22:56:00.000Z","updated_at":"2025-09-23T23:52:20.000Z","dependencies_parsed_at":"2024-06-19T02:51:08.636Z","dependency_job_id":"c231f4b5-30b3-48af-814b-77c6cde99ae7","html_url":"https://github.com/hyperjump-io/uri","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hyperjump-io/uri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjump-io%2Furi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjump-io%2Furi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjump-io%2Furi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjump-io%2Furi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperjump-io","download_url":"https://codeload.github.com/hyperjump-io/uri/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjump-io%2Furi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T06:11:06.460Z","updated_at":"2026-01-16T06:11:06.522Z","avatar_url":"https://github.com/hyperjump-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URI\nA small and fast library for validating, parsing, and resolving URIs\n([RFC 3986](https://www.rfc-editor.org/rfc/rfc3986)) and IRIs\n([RFC 3987](https://www.rfc-editor.org/rfc/rfc3987)).\n\n## Install\nDesigned for node.js (ES Modules, TypeScript) and browsers.\n\n```\nnpm install @hyperjump/uri\n```\n\n## Usage\n```javascript\nimport { resolveUri, parseUri, isUri, isIri } from \"@hyperjump/uri\"\n\nconst resolved = resolveUri(\"foo/bar\", \"http://example.com/aaa/bbb\"); // https://example.com/aaa/foo/bar\n\nconst components = parseUri(\"https://jason@example.com:80/foo?bar#baz\"); // {\n//   scheme: \"https\",\n//   authority: \"jason@example.com:80\",\n//   userinfo: \"jason\",\n//   host: \"example.com\",\n//   port: \"80\",\n//   path: \"/foo\",\n//   query: \"bar\",\n//   fragment: \"baz\"\n// }\n\nconst a = isUri(\"http://examplé.org/rosé#\"); // false\nconst a = isIri(\"http://examplé.org/rosé#\"); // true\n```\n\n## API\n### Resolve Relative References\nThese functions resolve relative-references against a base URI/IRI. The base\nURI/IRI must be absolute, meaning it must have a scheme (`https`) and no\nfragment (`#foo`). The resolution process will [normalize](#normalize) the\nresult.\n\n* **resolveUri**: (uriReference: string, baseUri: string) =\u003e string\n* **resolveIri**: (iriReference: string, baseIri: string) =\u003e string\n\n### Normalize\nThese functions apply the following normalization rules.\n1. Decode any unnecessarily percent-encoded characters.\n2. Convert any lowercase characters in the hex numbers of percent-encoded\n   characters to uppercase.\n3. Resolve and remove any dot-segments (`/.`, `/..`) in paths.\n4. Convert the scheme to lowercase.\n5. Convert the authority to lowercase.\n\n* **normalizeUri**: (uri: string) =\u003e string\n* **normalizeIri**: (iri: string) =\u003e string\n\n### To Relative\nThese functions convert a non-relative URI/IRI into a relative URI/IRI given a\nbase.\n\n* **toRelativeUri**: (uri: string, relativeTo: string) =\u003e string\n* **toRelativeIri**: (iri: string, relativeTo: string) =\u003e string\n\n### URI\nA [URI](https://www.rfc-editor.org/rfc/rfc3986#section-3) is not relative and\nmay include a fragment.\n\n* **isUri**: (value: string) =\u003e boolean\n* **parseUri**: (value: string) =\u003e IdentifierComponents\n* **toAbsoluteUri**: (value: string) =\u003e string\n\n    Takes a URI and strips its fragment component if it exists.\n\n### URI-Reference\nA [URI-reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.1) may be\nrelative.\n\n* **isUriReference**: (value: string) =\u003e boolean\n* **parseUriReference**: (value: string) =\u003e IdentifierComponents\n\n### absolute-URI\nAn [absolute-URI](https://www.rfc-editor.org/rfc/rfc3986#section-4.3) is not\nrelative an does not include a fragment.\n\n* **isAbsoluteUri**: (value: string) =\u003e boolean\n* **parseAbsoluteUri**: (value: string) =\u003e IdentifierComponents\n\n### IRI\nAn IRI is not relative and may include a fragment.\n\n* **isIri**: (value: string) =\u003e boolean\n* **parseIri**: (value: string) =\u003e IdentifierComponents\n* **toAbsoluteIri**: (value: string) =\u003e string\n\n    Takes an IRI and strips its fragment component if it exists.\n\n### IRI-reference\nAn IRI-reference may be relative.\n\n* **isIriReference**: (value: string) =\u003e boolean\n* **parseIriReference**: (value: string) =\u003e IdentifierComponents\n\n### absolute-IRI\nAn absolute-IRI is not relative an does not include a fragment.\n\n* **isAbsoluteIri**: (value: string) =\u003e boolean\n* **parseAbsoluteIri**: (value: string) =\u003e IdentifierComponents\n\n### Types\n* **IdentifierComponents**\n  * **scheme**: string\n  * **authority**: string\n  * **userinfo**: string\n  * **host**: string\n  * **port**: string\n  * **path**: string\n  * **query**: string\n  * **fragment**: string\n\n## Contributing\n### Tests\nRun the tests\n```\nnpm test\n```\n\nRun the tests with a continuous test runner\n```\nnpm test -- --watch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjump-io%2Furi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperjump-io%2Furi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjump-io%2Furi/lists"}