{"id":13716699,"url":"https://github.com/nblackburn/micro-match","last_synced_at":"2025-05-07T06:30:51.876Z","repository":{"id":10577643,"uuid":"66224513","full_name":"nblackburn/micro-match","owner":"nblackburn","description":"A micro library for matching urls.","archived":false,"fork":false,"pushed_at":"2023-01-09T04:51:21.000Z","size":464,"stargazers_count":34,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T05:30:12.170Z","etag":null,"topics":["micro","url-matching"],"latest_commit_sha":null,"homepage":"","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/nblackburn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://buymeacoffee.com/nblackburn"]}},"created_at":"2016-08-21T22:57:24.000Z","updated_at":"2023-09-05T08:20:26.000Z","dependencies_parsed_at":"2023-01-13T16:01:39.614Z","dependency_job_id":null,"html_url":"https://github.com/nblackburn/micro-match","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nblackburn%2Fmicro-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nblackburn%2Fmicro-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nblackburn%2Fmicro-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nblackburn%2Fmicro-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nblackburn","download_url":"https://codeload.github.com/nblackburn/micro-match/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224170780,"owners_count":17267608,"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":["micro","url-matching"],"created_at":"2024-08-03T00:01:13.436Z","updated_at":"2024-11-14T04:32:06.669Z","avatar_url":"https://github.com/nblackburn.png","language":"JavaScript","funding_links":["https://buymeacoffee.com/nblackburn"],"categories":["Modules"],"sub_categories":["Utilities"],"readme":"# micro match\n\nA simple url matching utility for micro.\n\n## Installation\n\nTo install micro match, simply run the following command in your terminal of choice.\n\n```bash\nnpm install -g micro-match\n```\n\nOnce you have installed micro match, simply include it in your project like so...\n\n```javascript\nconst { match, test } = require('micro-match');\n```\n\n## Usage\n\n### Match\n\nThe match method allows you to match a route binding to it's real world counterpart and return it's bindings.\n\n```javascript\nconst {id} = match('/users/:id', '/users/1');\n```\nParameters are defined as a comma followed by an alias to bind it's value to.\n\nYou can also create optional parameters by attaching a `?` suffix. This will allow both `/users` and `/users/1` to be matched.\n\nNow you will be able to access the `id` parameter with the value of `1` and handle it however ever you like.\n\n### Test\n\nThe test method allows you check if the pattern matches the given url.\n\n```javascript\ntest('/users/:id', '/users/1');\n```\n\n## Changes\n\nDetails for each release are documented in the [release notes](CHANGELOG.md).\n\n## License\n\nThis utility is licensed under [MIT](http://opensource.org/licenses/mit), see [LICENSE.md](LICENSE.md) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnblackburn%2Fmicro-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnblackburn%2Fmicro-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnblackburn%2Fmicro-match/lists"}