{"id":24289284,"url":"https://github.com/rla/router","last_synced_at":"2025-03-06T01:22:13.132Z","repository":{"id":57261580,"uuid":"10099836","full_name":"rla/router","owner":"rla","description":"Simplest hashchange regex router.","archived":false,"fork":false,"pushed_at":"2015-04-08T12:01:46.000Z","size":152,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T14:12:38.679Z","etag":null,"topics":["frontend","routing","routing-engine"],"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/rla.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":"2013-05-16T11:31:49.000Z","updated_at":"2023-09-29T00:08:07.000Z","dependencies_parsed_at":"2022-08-25T05:12:07.050Z","dependency_job_id":null,"html_url":"https://github.com/rla/router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Frouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Frouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Frouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rla%2Frouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rla","download_url":"https://codeload.github.com/rla/router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242128906,"owners_count":20076276,"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":["frontend","routing","routing-engine"],"created_at":"2025-01-16T10:51:48.571Z","updated_at":"2025-03-06T01:22:13.113Z","avatar_url":"https://github.com/rla.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hash-regex-router\n\nClient-side hashchange regex router for [singe-page applications](http://en.wikipedia.org/wiki/Single-page_application).\nWorks on Chrome 5, Firefox 3.6 and IE 10+.\n\nRoutes are processed in the order they are added.\n\n## Examples/API\n\nBasic usage:\n\n```javascript\nroute(/^about/, function() {\n    console.log('Showing the About page');\n});\n```\n\nWith capture groups:\n\n```javascript\nroute(/^profile\\/([0-9]+)/, function(uid) {\n    console.log('Showing the profile page for user ' + uid);\n});\n\n```\n\nDefault route:\n\n```javascript\nroute(/.*/, function() {\n    route.go('home');\n});\n```\n\nProgrammatically go to a route (#home):\n\n```javascript\nroute.go('home');\n```\n\nGoes to #profile/123:\n\n```javascript\nroute.go('profile', 123);\n```\n\nRefresh the current route:\n\n```javascript\nroute.refresh();\n```\n\nDisable routing:\n\n```javascript\nroute.disable();\n```\n\nRe-enable routing:\n\n```javascript\nroute.enable();\n```\n\nPrevent leaving current route:\n\n```javascript\nroute.leave = function() {\n    return confirm('Leave the current route?');\n};\n```\n\n## AMD/CommonJS\n\nThe source `router.js` uses CommonJS module format. `dist/router-standalone.js`\ncontains minified build in UMD format that supports both AMD and CommonJS environments and also\nsets global `route` when directly in browser.\n\nInstalling from NPM:\n\n    npm install hash-regex-router\n\nIf installed through NPM then the module can be directly used in browserify by simply require()'ing\nit:\n\n```javascript\nvar route = require('router');\n```\n\n## Building/testing\n\nInstall build dependencies:\n\n    npm install\n\nRun static server:\n\n    make serve-test\n\nRun tests:\n\n    make test\n\n## License\n\nThe MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frla%2Frouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frla%2Frouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frla%2Frouter/lists"}