{"id":15562141,"url":"https://github.com/mrkamel/routing-pattern","last_synced_at":"2026-02-02T12:08:05.056Z","repository":{"id":36946704,"uuid":"232982688","full_name":"mrkamel/routing-pattern","owner":"mrkamel","description":"A powerful, but minimal library to conveniently parse and stringify route patterns","archived":false,"fork":false,"pushed_at":"2023-06-08T13:50:21.000Z","size":2260,"stargazers_count":1,"open_issues_count":17,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T22:36:59.146Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrkamel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-01-10T06:38:10.000Z","updated_at":"2023-06-08T13:48:21.000Z","dependencies_parsed_at":"2025-02-13T03:37:11.679Z","dependency_job_id":null,"html_url":"https://github.com/mrkamel/routing-pattern","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkamel%2Frouting-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkamel%2Frouting-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkamel%2Frouting-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkamel%2Frouting-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrkamel","download_url":"https://codeload.github.com/mrkamel/routing-pattern/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrkamel%2Frouting-pattern/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259184739,"owners_count":22818266,"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":"2024-10-02T16:11:57.220Z","updated_at":"2026-02-02T12:08:00.023Z","avatar_url":"https://github.com/mrkamel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# routing-pattern\n\nA powerful, but minimal library (1.2K minified and gzipped) to conveniently parse and stringify route patterns\n\n## Installing / Getting started\n\n```sh\nyarn add routing-pattern\n```\n\n## Usage\n\nTo parse routes:\n\n```javascript\nimport { parseRoute } from 'routing-pattern'\n\nparseRoute('/products/3', '/products/:id')\n// =\u003e { id: '3' }\n\nparseRoute('/products/x', '/products/:id', { constraints: { id: '[0-9]+' } })\n// =\u003e null\n\nparseRoute('/en/sales/search/books/year/2019', /:locale/sales(/search/:q)(/year/:year))\n// =\u003e { locale: 'en', q: 'books', year: '2019' }\n\nparseRoute('/products/3?foo=bar', '/products/:id')\n// =\u003e { id: 3, foo: 'bar' }\n```\n\nTo stringify routes:\n\n```javascript\nimport { stringifyRoute } from 'routing-pattern'\n\nstringifyRoute('/:locale/sales(/search/:q)(/year/:year)', { locale: 'en', q: 'some query', year: '2019' })\n// =\u003e '/en/sales/search/some%20query/year/2019'\n\nstringifyRoute('/:locale/sales(/search/:q)(/year/:year)', { locale: 'en', q: 'some query' })\n// =\u003e '/en/sales/search/some%20query'\n\nstringifyRoute('/products/:id', {})\n// =\u003e null\n```\n\n## Versioning\n\nThis project is using the [Semantic Versioning specification](http://semver.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkamel%2Frouting-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrkamel%2Frouting-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkamel%2Frouting-pattern/lists"}