{"id":15437106,"url":"https://github.com/awwright/node-iri","last_synced_at":"2025-04-19T18:41:05.798Z","repository":{"id":11683412,"uuid":"14194296","full_name":"awwright/node-iri","owner":"awwright","description":"IRI parsing and IRI-URI conversion utilities, aimed at Node.js","archived":false,"fork":false,"pushed_at":"2022-08-31T03:21:54.000Z","size":18,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T18:18:03.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awwright.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}},"created_at":"2013-11-07T04:37:45.000Z","updated_at":"2024-10-07T01:15:05.000Z","dependencies_parsed_at":"2022-08-30T01:40:43.707Z","dependency_job_id":null,"html_url":"https://github.com/awwright/node-iri","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-iri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-iri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-iri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awwright%2Fnode-iri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awwright","download_url":"https://codeload.github.com/awwright/node-iri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249239260,"owners_count":21235826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-01T18:55:06.765Z","updated_at":"2025-04-16T12:30:47.850Z","avatar_url":"https://github.com/awwright.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IRI: A utility for converting and parsing URIs and IRIs\n\nUtilities for using \u003ca href=\"http://www.ietf.org/rfc/rfc3987.txt\"\u003eRFC 3987\u003c/a\u003e and\n\u003ca href=\"http://www.ietf.org/rfc/rfc3986.txt\"\u003eRFC 3986\u003c/a\u003e\n\nIRIs are unicode URIs, URIs by definition being 7-bit characters.\n\n## Construction of the URI\n\nFrom \u003ca href=\"http://www.ietf.org/rfc/rfc3986.txt\"\u003eRFC 3986\u003c/a\u003e:\n\n         foo://example.com:8042/over/there?name=ferret#nose\n         \\_/   \\______________/\\_________/ \\_________/ \\__/\n          |           |            |            |        |\n       scheme     authority       path        query   fragment\n          |   _____________________|__\n         / \\ /                        \\\n         urn:example:animal:ferret:nose\n\nThe authority exists in a URI/IRI and is marked by a leading `//`. It can be broken down into a number of other components:\n\n         root:hunter2@[::1]:8080\n         \\__________/ \\___/ \\__/\n               |        |    |\n           userinfo   host  port\n\n## Usage of `IRI`\n\nThe constructor takes a single argument, a URI or IRI string:\n\n\tvar iri = require('iri');\n\tvar path = new iri.IRI(str).resolveReference('/');\n\n### toString()\n\nReturns UTF-16 IRI\n\n### defrag()\n\nReturns the IRI without the fragment component. Useful for dereferencing URLs on a network.\n\n\tnew IRI().defrag() === 'http://example.com/resource'\n\n### isAbsolute()\n\nIRIs with a fragment are not absolute.\n\n### toAbsolute()\n\nResolves the IRI against itself, having the effect of stripping the fragment and checking that the supplied IRI is valid (absolute).\n\n### authority()\n\nReturns the authority component of the IRI, such as \"user:password@example.com:8080\"\n\n### fragment()\n\nReturns the fragment component of the IRI.\n\n### hierpart()\n\nReturns the hier-part of the IRI, the hierarchial component: Everything between the scheme and query, including leading `//` for the host, if it exists.\n\n### host()\n\nReturns the host component of the URI, either a domain name or string-formatted IP address. Excludes port number and username/password.\n\n### path()\n\nReturns the path component of the hier-part. Does not include the authority/host, query, or fragment.\n\n### port()\n\nReturns the port component of the authority as a string, or null if there is no port.\n\n### query()\n\nReturns the query component of the IRI including leading \"?\", or `null` if there is no query component.\n\n### resolveReference(ref)\n\nResolve the provided URI/IRI reference against this IRI.\n\n### scheme()\n\nReturns the scheme of the IRI, e.g. \"https\", \"file\", or \"urn\".\n\n### userinfo()\n\nReturns the username/password component of the IRI.\n\n### toURIString()\n\nReturns a URI formatted string with only 7-bit characters.\n\n### toIRIString()\n\nDecodes URI-encoded UTF-8 characters and returns a unicode string (Strings in ECMAScript/JavaScript are UTF-16).\n\n### toIRI()\n\nReturns a new IRI object with URI-encoded UTF-8 characters decoded.\n\n\n## Function Usage\n\n### iri.fromURI(uri)\n\nReturns an iri.IRI object with UTF-8 escaped characterd decoded.\n\n### iri.toIRIString(uri)\n\nReturns an IRI string decoded from the given URI.\n\n\n## Tests\n\nTests are available as a Vows test suite. Run `vows` in the package directory to execute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Fnode-iri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawwright%2Fnode-iri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawwright%2Fnode-iri/lists"}