{"id":16186220,"url":"https://github.com/zenflow/routeemitter","last_synced_at":"2025-04-07T13:21:50.046Z","repository":{"id":33162818,"uuid":"36803705","full_name":"zenflow/routeemitter","owner":"zenflow","description":"Isomorphic url router to (a) abstract urls as `Route`s, and (b) track and manipulate a \"current\" route, optionally (and by default) binding to document location on browser","archived":false,"fork":false,"pushed_at":"2015-06-09T06:32:43.000Z","size":520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T04:02:51.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zenflow.github.io/routeemitter/","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/zenflow.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":"2015-06-03T12:59:40.000Z","updated_at":"2015-06-09T06:16:50.000Z","dependencies_parsed_at":"2022-08-07T20:01:40.054Z","dependency_job_id":null,"html_url":"https://github.com/zenflow/routeemitter","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/zenflow%2Frouteemitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Frouteemitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Frouteemitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Frouteemitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenflow","download_url":"https://codeload.github.com/zenflow/routeemitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657248,"owners_count":20974350,"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-10T07:17:36.808Z","updated_at":"2025-04-07T13:21:50.011Z","avatar_url":"https://github.com/zenflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# routeemitter\nIsomorphic url router to (a) abstract urls as `Route`s, and (b) track and manipulate a \"current\" route, optionally (and by default) binding to document location on browser\n\n[![build status](https://travis-ci.org/zenflow/routeemitter.svg?branch=master)](https://travis-ci.org/zenflow/routeemitter?branch=master)\n[![dependencies](https://david-dm.org/zenflow/routeemitter.svg)](https://david-dm.org/zenflow/routeemitter)\n[![dev-dependencies](https://david-dm.org/zenflow/routeemitter/dev-status.svg)](https://david-dm.org/zenflow/routeemitter#info=devDependencies)\n\n[![npm](https://nodei.co/npm/routeemitter.svg?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/routeemitter)\n\n## [documentation](https://zenflow.github.io/routeemitter/)\n\n## installation\n\n```\nnpm install --save routeemitter\n```\n\n## example\n\n```js\nvar RouteEmitter = require('routeemitter');\nvar presenter = require('./presenter');\nvar api = require('./api');\n\nvar router = new RouteEmitter({\n    home: '/',\n    blog: '/blog(/tag/:tag)(/:slug)',\n    contact: '/contact'\n}, {/* options... */});\n\nrouter.on('route', function(route, old_route){\n    presenter.updatePage(route, old_route);\n    if (route.name=='blog'){\n        if (route.params.tag){\n            api.getBlogsByTag(route.params.tag).then(function(blogs){\n                presenter.updateBlogList(blogs);\n            });\n        }\n        if (route.params.slug){\n            api.getBlogBySlug(route.params.tag).then(function(blog){\n                presenter.updateCurrentBlog(blog);\n            });\n        }\n    }\n});\n\n```\n\n## changelog\n\n### 0.1.0\n- Initial release as RouteEmitter","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Frouteemitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenflow%2Frouteemitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Frouteemitter/lists"}