{"id":18660066,"url":"https://github.com/nepaul/rest-url-parser","last_synced_at":"2025-10-04T11:49:24.640Z","repository":{"id":172936662,"uuid":"649954992","full_name":"nepaul/rest-url-parser","owner":"nepaul","description":"Simplifies managing parameter-inclusive URLs, especially useful for applications handling REST APIs with URL-embedded resource identifiers.","archived":false,"fork":false,"pushed_at":"2023-06-14T02:40:04.000Z","size":515,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-09T14:50:55.038Z","etag":null,"topics":["api-rest","axios","fetch","got","http","http-client","https","needle","request","rest-api","restful-api","sse","superagent","url"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nepaul/rest-url-parser","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/nepaul.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}},"created_at":"2023-06-06T02:31:34.000Z","updated_at":"2025-04-06T13:21:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"eecf9d45-8e7b-4cd8-a4da-15a886fe4884","html_url":"https://github.com/nepaul/rest-url-parser","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"f913bb5481b03621a649527cd93d275ea95a0c3f"},"previous_names":["nepaul/rest-url-parser"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/nepaul/rest-url-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nepaul%2Frest-url-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nepaul%2Frest-url-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nepaul%2Frest-url-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nepaul%2Frest-url-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nepaul","download_url":"https://codeload.github.com/nepaul/rest-url-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nepaul%2Frest-url-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260852786,"owners_count":23072736,"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":["api-rest","axios","fetch","got","http","http-client","https","needle","request","rest-api","restful-api","sse","superagent","url"],"created_at":"2024-11-07T07:38:56.625Z","updated_at":"2025-10-04T11:49:19.610Z","avatar_url":"https://github.com/nepaul.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/nepaul/rest-url-parser\"\u003e\n    \u003cimg src=\"./assets/logo.png\" width=\"256\" alt=\"Rest URL Parser\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Rest URL Parser\n\n[![license](https://img.shields.io/github/license/nepaul/rest-url-parser)](https://github.com/nepaul/rest-url-parser)\n[![npm](https://img.shields.io/npm/v/@nepaul/rest-url-parser)](https://www.npmjs.com/package/@nepaul/rest-url-parser)\n\nOnly a function called `parseRequestURL()`. \n\nSimplify the handling of URLs that contain parameters..\n\nIt's particularly useful for applications that deal with REST APIs where resource identifiers are embedded in the URL.\n\n## Table of Contents\n\n- [Rest URL Parser](#rest-url-parser)\n  - [Table of Contents](#table-of-contents)\n  - [Get Started](#get-started)\n    - [Install](#install)\n  - [Usage](#usage)\n  - [API](#api)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Get Started\n\n### Install\n\nThis project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Please install them first.\n\n```sh\nnpm install  @nepaul/rest-url-parser\n```\n\n## Usage\n\n```javascript\nimport parseRequestURL from '@nepaul/rest-url-parser';\n\nconst sourceConfig = {\n  url: '/user/:userId/post/:postId',\n  params: {\n    userId: '123',\n    postId: '456',\n  },\n};\n\nconst result = parseRequestURL(sourceConfig);\n\nconsole.log(result);\n```\n\nUse with Axios:\n\n```javascript\nimport parseRequestURL from '@nepaul/rest-url-parser';\n\nconst instance = axios.create(appConfig.httpClient);\n\nconst requestInterceptor = instance.interceptors.request.use(\n  function (config) {\n    const restConfig = parseRequestURL(config);\n    return restConfig;\n  },\n  function (error) {\n    return Promise.reject(error);\n  }\n);\n\ninstance.post('/user/:userId/post/:postId', {\n  userId: '123',\n  postId: '456',\n});\n```\n\n## API\n\n**parseRequestURL(sourceConfig)**\n\nThis function takes a `sourceConfig` object and parses the `url` property for parameters. It returns the updated `sourceConfig`.\n\n```javascript\nparseRequestURL(sourceConfig);\n```\n\n## Contributing\n\nYour contributions and suggestions are heartily welcome.\nSubmit an issue or submit a pull request.\n\nThanks to all the people who already contributed!\n\n\u003ca href=\"https://github.com/nepaul/rest-url-parser/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=nepaul/rest-url-parser\" /\u003e\n\u003c/a\u003e\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnepaul%2Frest-url-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnepaul%2Frest-url-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnepaul%2Frest-url-parser/lists"}