{"id":17137750,"url":"https://github.com/xuexb/urlpath","last_synced_at":"2025-03-24T07:17:21.754Z","repository":{"id":57387730,"uuid":"87501037","full_name":"xuexb/urlpath","owner":"xuexb","description":"url路径解析","archived":false,"fork":false,"pushed_at":"2017-04-07T06:17:01.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T03:23:42.522Z","etag":null,"topics":["url","url-parser","urlpath"],"latest_commit_sha":null,"homepage":null,"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/xuexb.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":"2017-04-07T03:35:28.000Z","updated_at":"2023-09-08T17:23:19.000Z","dependencies_parsed_at":"2022-09-06T09:41:44.397Z","dependency_job_id":null,"html_url":"https://github.com/xuexb/urlpath","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuexb%2Furlpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuexb%2Furlpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuexb%2Furlpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuexb%2Furlpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuexb","download_url":"https://codeload.github.com/xuexb/urlpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245224585,"owners_count":20580369,"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":["url","url-parser","urlpath"],"created_at":"2024-10-14T20:07:48.973Z","updated_at":"2025-03-24T07:17:21.726Z","avatar_url":"https://github.com/xuexb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# urlpath\n\nurl路径解析, 为了解决在拼接链接中多个`/`连接问题, 感谢 [@52cik](http://github.com/52cik)\n\n[![code style fecs](https://img.shields.io/badge/code%20style-fecs-brightgreen.svg)](https://github.com/ecomfe/fecs)\n[![NPM Version](https://img.shields.io/npm/v/urlpath.svg)](https://www.npmjs.com/package/urlpath)\n[![NPM Downloads](https://img.shields.io/npm/dm/urlpath.svg)](https://www.npmjs.com/package/urlpath)\n[![Linux Build](https://img.shields.io/travis/xuexb/urlpath/master.svg?label=linux)](https://travis-ci.org/xuexb/urlpath)\n[![Test Coverage](https://img.shields.io/coveralls/xuexb/urlpath/master.svg)](https://coveralls.io/r/xuexb/urlpath?branch=master)\n\n---\n\n### 例子\n\n```js\nurlpath('//xuexb.com/', '//static/a.js')                        // '//xuexb.com/static/a.js'\n\nurlpath('http://xuexb.com/', '//', '//static//', '/a.js')       // 'http://xuexb.com/static/a.js'\nurlpath('http://xuexb.com/////static///a.js')                   // 'http://xuexb.com/static/a.js'\n```\n\n请注意和 [url.resolve](https://nodejs.org/api/url.html#url_url_resolve_from_to) 的区别:\n\n```\nurl.resolve('http://example.com/', '/one')                      // 'http://example.com/one'\nurl.resolve('http://example.com/one', '/two')                   // 'http://example.com/two'\n\n\nurlpath('http://example.com/', '/one')                          // 'http://example.com/one'\nurlpath('http://example.com/one', '/one')                       // 'http://example.com/one/one'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuexb%2Furlpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuexb%2Furlpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuexb%2Furlpath/lists"}