{"id":20645996,"url":"https://github.com/jakecyr/node-url-path","last_synced_at":"2026-04-15T11:37:00.524Z","repository":{"id":190091728,"uuid":"681924341","full_name":"jakecyr/node-url-path","owner":"jakecyr","description":"Simple utility class to help join URL parts and add query parameters.","archived":false,"fork":false,"pushed_at":"2023-08-23T04:27:13.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T09:35:46.404Z","etag":null,"topics":["node","nodejs","pathlib","paths","urls","utility"],"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/jakecyr.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}},"created_at":"2023-08-23T04:04:47.000Z","updated_at":"2023-08-23T04:27:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b1bf52e-b4c2-4d27-ae9b-d75057cfd6be","html_url":"https://github.com/jakecyr/node-url-path","commit_stats":null,"previous_names":["jakecyr/node-url-path"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fnode-url-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fnode-url-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fnode-url-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fnode-url-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakecyr","download_url":"https://codeload.github.com/jakecyr/node-url-path/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242714050,"owners_count":20173581,"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":["node","nodejs","pathlib","paths","urls","utility"],"created_at":"2024-11-16T16:22:58.196Z","updated_at":"2026-04-15T11:36:55.482Z","avatar_url":"https://github.com/jakecyr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node URL Path\n\nSimple utility class to help join URLs and add query parameters to URLs similar to how Python's pathlib Path object works with file paths.\n\n## Installation\n\nInstall the latest version using `npm` with:\n\n```bash\nnpm install node-url-path\n```\n\n## Usage\n\nUsing the `URLPath` class makes working with URLs simple. You can add paths to a URL that already has query parameters added to it and add additional query parameters if needed with the call of a method.\n\nAll `URLPath` methods return a `URLPath` instance so you can chain them together.\n\nGet the final URL from a `URLPath` instance by retrieving the public `href` property.\n\n```typescript\nimport { URLPath } from 'node-url-path';\n\nconst urlPath = new URLPath('https://google.com/api/')\n  .joinPath('/query')\n  .addQueryParams({\n    query: 'How to make URLs easier when working with Node',\n    apiKey: '1234567890',\n  });\n\nconsole.log(urlPath.href);\n\n// Outputs:\n// https://google.com/api/query?query=How%20to%20make%20URLs%20easier%20when%20working%20with%20Node\u0026apiKey=1234567890\n```\n\nor a more complex example:\n\n```typescript\nimport { URLPath } from 'node-url-path';\n\nconst urlPath = new URLPath('https://google.com/api/?someExistingParams=1')\n  .joinPath('/query')\n  .addQueryParams({\n    query: 'How to make URLs easier when working with Node',\n    apiKey: '1234567890',\n  });\n\nconsole.log(urlPath.href);\n\n// Outputs:\n// https://google.com/api/query?someExistingParams=1\u0026query=How%20to%20make%20URLs%20easier%20when%20working%20with%20Node\u0026apiKey=1234567890\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fnode-url-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakecyr%2Fnode-url-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fnode-url-path/lists"}