{"id":22747230,"url":"https://github.com/one-com/normalizeurl","last_synced_at":"2025-08-13T21:44:31.710Z","repository":{"id":10936257,"uuid":"13241990","full_name":"One-com/normalizeurl","owner":"One-com","description":"Normalize urls by removing .. and . constructs, and only percent-encode the bytes that encodeURIComponent would.","archived":false,"fork":false,"pushed_at":"2016-08-19T08:06:16.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-07-21T01:39:23.145Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/One-com.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}},"created_at":"2013-10-01T11:33:13.000Z","updated_at":"2016-05-09T15:20:19.000Z","dependencies_parsed_at":"2022-08-30T23:22:20.304Z","dependency_job_id":null,"html_url":"https://github.com/One-com/normalizeurl","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/One-com/normalizeurl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnormalizeurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnormalizeurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnormalizeurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnormalizeurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-com","download_url":"https://codeload.github.com/One-com/normalizeurl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fnormalizeurl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270322840,"owners_count":24564651,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-12-11T03:13:49.494Z","updated_at":"2025-08-13T21:44:31.663Z","avatar_url":"https://github.com/One-com.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# normalizeurl\n\nNormalize a url or url fragment by percent-encoding exactly the chars\nencodeURIComponent does and removing `/./` and `/foo/../` constructs\nlike `require('path').resolve` does.\n\nExample:\n\n```javascript\nvar normalizeUrl = require('normalizeurl');\n\nconsole.log(normalizeUrl('http://example.com/%7efoo%2Ebar'));\n// =\u003e 'http://example.com/~foo.bar'\n\nconsole.log(normalizeUrl('http://example.com/foo/./bar/quux/../blah'));\n// =\u003e 'http://example.com/foo/bar/blah'\n```\n\nIt also does the right thing for relative, root-relative, and protocol-relative urls:\n```javascript\nconsole.log(normalizeUrl('foo/bar/../blah'));\n// =\u003e 'foo/bar/blah'\n\nconsole.log(normalizeUrl('/hey/there/../you?blah?#foo%7e'));\n// =\u003e '/hey/you?blah?#foo~'\n\nconsole.log(normalizeUrl('//example.com/%7efoo'));\n// =\u003e '//example.com/~foo'\n```\n\nUrl objects already parsed by node.js' built-in `url` module are also supported:\n\n```javascript\nconsole.log(normalizeUrl(require('url').parse('htTP://foo.com/%7ebarf')));\n// =\u003e {protocol: 'http:', slashes: true, host: 'foo.com', hostname: 'foo.com', pathname: '/~barf', href: 'http://foo.com/~barf', path: '/~barf'}\n```\n\nThe module works also works in a browser, but only for url fragments\nfor now. It'll throw an exception if you attempt to normalize an\nabsolute or protocol-relative url, as that currently relies on\n`require('url').parse`.\n\n## License\n\nnormalizeurl is licensed under a standard 3-clause BSD license -- see the `LICENSE`-file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fnormalizeurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-com%2Fnormalizeurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fnormalizeurl/lists"}