{"id":28252927,"url":"https://github.com/dunkbing/route-path-builder","last_synced_at":"2025-06-15T22:30:37.847Z","repository":{"id":250981418,"uuid":"836050647","full_name":"dunkbing/route-path-builder","owner":"dunkbing","description":"A small typescript library for building type-safe route paths with support for path and query parameters.","archived":false,"fork":false,"pushed_at":"2024-07-31T04:54:37.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T16:17:09.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/route-path-builder","language":"TypeScript","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/dunkbing.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":"2024-07-31T04:15:03.000Z","updated_at":"2024-11-28T08:37:38.000Z","dependencies_parsed_at":"2024-07-31T06:09:27.559Z","dependency_job_id":null,"html_url":"https://github.com/dunkbing/route-path-builder","commit_stats":null,"previous_names":["dunkbing/route-path-builder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dunkbing/route-path-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunkbing%2Froute-path-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunkbing%2Froute-path-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunkbing%2Froute-path-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunkbing%2Froute-path-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dunkbing","download_url":"https://codeload.github.com/dunkbing/route-path-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunkbing%2Froute-path-builder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260060238,"owners_count":22953077,"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":[],"created_at":"2025-05-19T16:17:06.737Z","updated_at":"2025-06-15T22:30:37.833Z","avatar_url":"https://github.com/dunkbing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Route Builder\n\nA small typescript library for building type-safe route paths with support for\npath and query parameters.\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install route-path-builder\n```\n\nUsing jsr:\n\n```bash\nnpx jsr add @dunkbing/route-path-builder\n```\n\nUsage Creating a Single Route Path\n\n```typescript\nimport { createRoutePath } from \"route-path-builder\";\n\nconst productPath = createRoutePath(\"/catalog/:category/:name\");\n\n// Generate path with parameters\nconst url1 = productPath({ category: \"cloth\", name: \"shirt\" });\nconsole.log(url1); // Output: /catalog/cloth/shirt\n\n// Generate path with parameters and query parameters\ntype QueryParams = {\n  param1: string;\n  param2: string;\n};\nconst url2 = productPath\u003cQueryParams\u003e(\n  { category: \"cloth\", name: \"shirt\" },\n  { param1: \"test\", param2: \"test2\" },\n);\nconsole.log(url2); // Output: /catalog/cloth/shirt?param1=test\u0026param2=test2\n```\n\n```typescript\nimport { createRoutePaths } from \"route-path-builder\";\n\nconst routes = createRoutePaths([\n  { name: \"product\", path: \"/catalog/:category/:name\" },\n  { name: \"user\", path: \"/user/:id\" },\n]);\nconst productPath = routes.product({ category: \"cloth\", name: \"shirt\" });\nconsole.log(productPath); // Output: /catalog/cloth/shirt\n\nconst userPath = routes.user({ id: \"123\" });\nconsole.log(userPath); // Output: /user/123\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunkbing%2Froute-path-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdunkbing%2Froute-path-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunkbing%2Froute-path-builder/lists"}