{"id":14969147,"url":"https://github.com/fastify/fast-uri","last_synced_at":"2025-05-15T09:04:47.730Z","repository":{"id":37012714,"uuid":"419317518","full_name":"fastify/fast-uri","owner":"fastify","description":"Dependency-free RFC 3986 URI toolbox","archived":false,"fork":false,"pushed_at":"2025-03-31T14:42:14.000Z","size":145,"stargazers_count":91,"open_issues_count":8,"forks_count":8,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-11T06:38:27.359Z","etag":null,"topics":["fastify-library","uri","uri-parser"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/fast-uri","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"fastify","open_collective":"fastify"}},"created_at":"2021-10-20T12:20:22.000Z","updated_at":"2025-03-31T14:42:15.000Z","dependencies_parsed_at":"2023-12-18T13:30:38.504Z","dependency_job_id":"10809c4d-2daa-42e8-aa29-d52138cc2397","html_url":"https://github.com/fastify/fast-uri","commit_stats":{"total_commits":92,"total_committers":12,"mean_commits":7.666666666666667,"dds":0.7391304347826086,"last_synced_commit":"a79e2061bc3d3e8e6d06ee091be02d66d2a7f3e2"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":"fastify/skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffast-uri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffast-uri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffast-uri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffast-uri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","download_url":"https://codeload.github.com/fastify/fast-uri/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248909011,"owners_count":21181626,"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":["fastify-library","uri","uri-parser"],"created_at":"2024-09-24T13:41:12.514Z","updated_at":"2025-04-14T15:48:28.409Z","avatar_url":"https://github.com/fastify.png","language":"JavaScript","readme":"# fast-uri\n\n\u003cdiv align=\"center\"\u003e\n\n[![NPM version](https://img.shields.io/npm/v/fast-uri.svg?style=flat)](https://www.npmjs.com/package/fast-uri)\n[![CI](https://github.com/fastify/fast-uri/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fast-uri/actions/workflows/ci.yml)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\n\u003c/div\u003e\n\nDependency-free RFC 3986 URI toolbox.\n\n## Usage\n\n## Options\n\nAll of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties:\n\n*\t`scheme` (string)\n\tIndicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior.\n\n*\t`reference` (string)\n\tIf set to `\"suffix\"`, it indicates that the URI is in the suffix format and the parser will use the option's `scheme` property to determine the URI's scheme.\n\n*\t`tolerant` (boolean, false)\n\tIf set to `true`, the parser will relax URI resolving rules.\n\n*\t`absolutePath` (boolean, false)\n\tIf set to `true`, the serializer will not resolve a relative `path` component.\n\n*\t`unicodeSupport` (boolean, false)\n\tIf set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt).\n\n*\t`domainHost` (boolean, false)\n\tIf set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt).\n\n### Parse\n\n```js\nconst uri = require('fast-uri')\nuri.parse('uri://user:pass@example.com:123/one/two.three?q1=a1\u0026q2=a2#body')\n// Output\n{\n  scheme: \"uri\",\n  userinfo: \"user:pass\",\n  host: \"example.com\",\n  port: 123,\n  path: \"/one/two.three\",\n  query: \"q1=a1\u0026q2=a2\",\n  fragment: \"body\"\n}\n```\n\n### Serialize\n\n```js\nconst uri = require('fast-uri')\nuri.serialize({scheme: \"http\", host: \"example.com\", fragment: \"footer\"})\n// Output\n\"http://example.com/#footer\"\n\n```\n\n### Resolve\n\n```js\nconst uri = require('fast-uri')\nuri.resolve(\"uri://a/b/c/d?q\", \"../../g\")\n// Output\n\"uri://a/g\"\n```\n\n### Equal\n\n```js\nconst uri = require('fast-uri')\nuri.equal(\"example://a/b/c/%7Bfoo%7D\", \"eXAMPLE://a/./b/../b/%63/%7bfoo%7d\")\n// Output\ntrue\n```\n\n## Scheme supports\n\nfast-uri supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme)-dependent processing rules. Currently, fast-uri has built-in support for the following schemes:\n\n*\thttp \\[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\\]\n*\thttps \\[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\\]\n*\tws \\[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\\]\n*\twss \\[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\\]\n*\turn \\[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\\]\n*\turn:uuid \\[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\\]\n\n\n## Benchmarks\n\n```\nfast-uri: parse domain x 1,306,864 ops/sec ±0.31% (100 runs sampled)\nurijs: parse domain x 483,001 ops/sec ±0.09% (99 runs sampled)\nWHATWG URL: parse domain x 862,461 ops/sec ±0.18% (97 runs sampled)\nfast-uri: parse IPv4 x 2,381,452 ops/sec ±0.26% (96 runs sampled)\nurijs: parse IPv4 x 384,705 ops/sec ±0.34% (99 runs sampled)\nWHATWG URL: parse IPv4 NOT SUPPORTED\nfast-uri: parse IPv6 x 923,519 ops/sec ±0.09% (100 runs sampled)\nurijs: parse IPv6 x 289,070 ops/sec ±0.07% (95 runs sampled)\nWHATWG URL: parse IPv6 NOT SUPPORTED\nfast-uri: parse URN x 2,596,395 ops/sec ±0.42% (98 runs sampled)\nurijs: parse URN x 1,152,412 ops/sec ±0.09% (97 runs sampled)\nWHATWG URL: parse URN x 1,183,307 ops/sec ±0.38% (100 runs sampled)\nfast-uri: parse URN uuid x 1,666,861 ops/sec ±0.10% (98 runs sampled)\nurijs: parse URN uuid x 852,724 ops/sec ±0.17% (95 runs sampled)\nWHATWG URL: parse URN uuid NOT SUPPORTED\nfast-uri: serialize uri x 1,741,499 ops/sec ±0.57% (95 runs sampled)\nurijs: serialize uri x 389,014 ops/sec ±0.28% (93 runs sampled)\nfast-uri: serialize IPv6 x 441,095 ops/sec ±0.37% (97 runs sampled)\nurijs: serialize IPv6 x 255,443 ops/sec ±0.58% (94 runs sampled)\nfast-uri: serialize ws x 1,448,667 ops/sec ±0.25% (97 runs sampled)\nurijs: serialize ws x 352,884 ops/sec ±0.08% (96 runs sampled)\nfast-uri: resolve x 340,084 ops/sec ±0.98% (98 runs sampled)\nurijs: resolve x 225,759 ops/sec ±0.37% (95 runs sampled)\n```\n\n## TODO\n\n- [ ] Support MailTo\n- [ ] Be 100% iso compatible with uri-js\n- [ ] Add browser test stack\n\n## License\n\nLicensed under [BSD-3-Clause](./LICENSE).\n","funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffast-uri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastify%2Ffast-uri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffast-uri/lists"}