{"id":18067616,"url":"https://github.com/alanclarke/urlite","last_synced_at":"2025-04-07T07:06:45.889Z","repository":{"id":3052092,"uuid":"45650306","full_name":"alanclarke/urlite","owner":"alanclarke","description":"A very small, fast, dependency free url parser and formatter for nodejs and the web","archived":false,"fork":false,"pushed_at":"2023-10-17T04:58:29.000Z","size":1586,"stargazers_count":308,"open_issues_count":22,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-16T08:31:53.300Z","etag":null,"topics":["ceh","cmh","implement"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanclarke.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":"2015-11-06T01:04:26.000Z","updated_at":"2024-08-27T14:57:37.000Z","dependencies_parsed_at":"2023-02-15T09:01:32.751Z","dependency_job_id":"f6d1995b-bbe1-4da9-bff5-0460e186bb45","html_url":"https://github.com/alanclarke/urlite","commit_stats":{"total_commits":63,"total_committers":6,"mean_commits":10.5,"dds":0.3015873015873016,"last_synced_commit":"26d70f66091139131cad9decd4f07f36e5077b51"},"previous_names":["qubitproducts/urlite"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanclarke%2Furlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanclarke%2Furlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanclarke%2Furlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanclarke%2Furlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanclarke","download_url":"https://codeload.github.com/alanclarke/urlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260748,"owners_count":20910069,"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":["ceh","cmh","implement"],"created_at":"2024-10-31T07:09:54.885Z","updated_at":"2025-04-07T07:06:45.863Z","avatar_url":"https://github.com/alanclarke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![urlite](https://cloud.githubusercontent.com/assets/640611/11125144/30a12ab0-8960-11e5-91ba-dfb682572a6c.png)\n\nA very small, fast, dependency free url parser and formatter for nodejs and the web\n\n- fast\n- few lines of code\n- 100% test coverage\n\n## why is it so small and fast?\nIt extracts all url fragments in a single step using one massive regex\n\n## usage\n```js\nnpm install --save urlite\n\nvar url = require('urlite')\n\nurl.parse('http://user:pass@blah.com:3000/path?query=string#fragment')\n\n{\n  auth: 'user:pass',\n  hash: '#fragment',\n  hostname: 'blah.com',\n  href: 'http://user:pass@blah.com:3000/path?query=string#fragment',\n  path: '/path?query=string',\n  pathname: '/path',\n  port: '3000',\n  protocol: 'http:',\n  search: '?query=string'\n}\n\nvar href = window.location.href\nurl.format(url.parse(href)) === href\n```\n\n## Urlite extra\nAn extended version of urlite is available at `urlite/extra`. This includes helpful features such as querystring, hash and auth parsing:\n\n```js\n// version of urlite with additional extras like querystring and auth parsing\nvar url = require('urlite/extra')\nvar parsed = url.parse('http://user:pass@blah.com:3000/path?a=b#c=d')\nparsed.search // -\u003e { a: \"b\" }\nparsed.search.a = 'c'\nparsed.hash // -\u003e { c: \"d\" }\nparsed.hash.c = 'e'\nparsed.auth // -\u003e { user: 'user', password: 'password' }\nurl.format(parsed) // -\u003e 'http://user:pass@blah.com:3000/path?a=c#c=e'\n```\n\n# comparison\n```\nFile size:\n\nNAME                    SIZE        SIZE (minified)\nurlite                  3.02 kB     0.957 kB\nurlparser               5.82 kB     1.57 kB\nurl-parse               12 kB       2.89 kB\nurl                     46.5 kB     11.8 kB\nmin-url                 25.6 kB     12.6 kB\nfast-url-parser         55.2 kB     15 kB\nurl-parse-as-address    78.7 kB     22.7 kB\n```\n\n```\nPerformance:\n\nrequire(\"urlite\").parse             2,210,417 ops/sec ±0.90% (95 runs sampled)\nrequire(\"fast-url-parser\").parse    2,047,302 ops/sec ±0.89% (95 runs sampled)\nrequire(\"urlparser\").parse          631,561 ops/secs ±0.87% (92 runs sampled)\nrequire(\"min-url\").parse            343,680 ops/sec ±1.16% (93 runs sampled)\nrequire(\"url-parse\")                334,385 ops/sec ±1.03% (97 runs sampled)\nrequire(\"url\").parse                140,836 ops/sec ±1.26% (94 runs sampled)\nrequire(\"url-parse-as-address\")     135,691 ops/sec ±0.94% (95 runs sampled)\n```\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n\n\n## Want to work on this for your day job?\n\nThis project was created by the Engineering team at Qubit. As we use open source libraries, we make our projects public where possible.\n\nWe’re currently looking to grow our team, so if you’re a JavaScript engineer and keen on ES2016 React+Redux applications and Node micro services, why not get in touch? Work with like minded engineers in an environment that has fantastic perks, including an annual ski trip, yoga, a competitive foosball league, and copious amounts of yogurt.\n\nFind more details on our Engineering site. Don’t have an up to date CV? Just link us your Github profile! Better yet, send us a pull request that improves this project.`\nContact GitHub API Training Shop Blog About\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanclarke%2Furlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanclarke%2Furlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanclarke%2Furlite/lists"}