{"id":28708355,"url":"https://github.com/bpierre/miniroutes","last_synced_at":"2025-10-30T05:48:22.164Z","repository":{"id":14726769,"uuid":"17447502","full_name":"bpierre/miniroutes","owner":"bpierre","description":"Mini routing system based on regular expressions","archived":false,"fork":false,"pushed_at":"2019-02-13T17:18:01.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T21:12:12.159Z","etag":null,"topics":["routing"],"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/bpierre.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}},"created_at":"2014-03-05T16:45:58.000Z","updated_at":"2023-03-08T04:15:50.000Z","dependencies_parsed_at":"2022-08-03T04:45:17.498Z","dependency_job_id":null,"html_url":"https://github.com/bpierre/miniroutes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bpierre/miniroutes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpierre%2Fminiroutes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpierre%2Fminiroutes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpierre%2Fminiroutes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpierre%2Fminiroutes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bpierre","download_url":"https://codeload.github.com/bpierre/miniroutes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpierre%2Fminiroutes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259628322,"owners_count":22887023,"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":["routing"],"created_at":"2025-06-14T18:11:10.263Z","updated_at":"2025-10-30T05:48:22.084Z","avatar_url":"https://github.com/bpierre.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miniroutes [![Build Status](https://travis-ci.org/bpierre/miniroutes.png?branch=master)](https://travis-ci.org/bpierre/miniroutes)\n\nMini routing system based on regular expressions.\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"763\" height=\"256\" alt=\"miniroutes illustration\" src=\"http://scri.ch/ls3-2x.png\"\u003e\u003c/p\u003e\n\n## Usage\n\n```js\nvar miniroutes = require('miniroutes');\n\nvar paths = [\n\n  // Match 'foo' and 'foo/'\n  [ 'foo', /^foo\\/?$/ ],\n\n  // Match 'bar', 'bar/\u003canything\u003e', 'bar/\u003canything\u003e/\u003canything\u003e'\n  [ 'bar', /^bar(?:\\/([^\\/]+))?(?:\\/([^\\/]+))?\\/?$/ ]\n\n];\n\nvar routing = miniroutes(paths, function(route, previous) {\n  // `route` is the matched route\n  // `previous` is the previously matched route\n  console.log(route);\n});\n\nrouting('foo');\n// Console output: { name: 'foo',\n//                   params: [],\n//                   path: 'foo' }\n\nrouting('bar/param1');\n// Console output: { name: 'bar',\n//                   params: ['param1', null],\n//                   path: 'bar/param1' }\n\nrouting('bar/param1/param2');\n// Console output: { name: 'bar',\n//                   params: ['param1', 'param2'],\n//                   path: 'bar/param1/param2' }\n```\n\nYou can also combine miniroutes with [minihash](https://github.com/bpierre/minihash):\n\n```js\nvar miniroutes = require('miniroutes');\nvar minihash = require('minihash');\n\nvar routes = [ /* … */ ];\n\nvar hash = minihash('!/', miniroutes(routes, function(route, previous) {\n  console.log(route, previous);\n}));\n```\n\n## Installation\n\n```\n$ npm install miniroutes\n```\n\n## Browser compatibility\n\nIE9+ and modern browsers.\n\n[![Browser support](https://ci.testling.com/bpierre/miniroutes.png)](https://ci.testling.com/bpierre/miniroutes)\n\n## License\n\n[MIT](LICENSE)\n\n## Special thanks\n\nIllustration made by [Raphaël Bastide](http://raphaelbastide.com/) with [scri.ch](http://scri.ch/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpierre%2Fminiroutes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbpierre%2Fminiroutes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpierre%2Fminiroutes/lists"}