{"id":18790589,"url":"https://github.com/mvneerven/vanillarouter","last_synced_at":"2025-04-13T14:12:45.899Z","repository":{"id":46903442,"uuid":"427080270","full_name":"mvneerven/vanillarouter","owner":"mvneerven","description":"A fully functional Vanilla ES6 hash and history based router for any SPA/PWA.","archived":false,"fork":false,"pushed_at":"2021-12-08T17:33:48.000Z","size":11,"stargazers_count":40,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T14:12:42.622Z","etag":null,"topics":["es6","es6-javascript","es6-modules","pwa-apps","single-page-app","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvneerven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-11T17:06:10.000Z","updated_at":"2024-10-05T04:15:55.000Z","dependencies_parsed_at":"2022-09-11T18:50:46.887Z","dependency_job_id":null,"html_url":"https://github.com/mvneerven/vanillarouter","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/mvneerven%2Fvanillarouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvneerven%2Fvanillarouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvneerven%2Fvanillarouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvneerven%2Fvanillarouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvneerven","download_url":"https://codeload.github.com/mvneerven/vanillarouter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"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":["es6","es6-javascript","es6-modules","pwa-apps","single-page-app","vanilla-javascript","vanilla-js"],"created_at":"2024-11-07T21:12:56.242Z","updated_at":"2025-04-13T14:12:45.877Z","avatar_url":"https://github.com/mvneerven.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vanillarouter\n\nOne of the first reasons people select a JavaScript framework for SPAs/PWAs is the fact that JavaScript doesn't have a built-in router.\n\nJavaScript does however include all it takes to create an efficient and easy to use routing mechanism. \n\nThis one is pure, Vanilla ES6. A fully functional *hash* and *history* router for any SPA/PWA.\n\n## Features\n\n- History-based routing (```pushState```/```popState```)\n- Hash-based routing (```hashchange```)\n- Native JS Events\n- Complete decoupling of any component architecture: you decide what to do with the ```route``` event\n- Extremely tiny footprint.\n\n## Installation\n\nNone\n\n## Demo\n\nSee a working [demo](https://vanillaroute.z6.web.core.windows.net/), hosted as a Serverless Static Website on Azure Blob Storage. \n\n## Usage\n\n```js\nconst router = new VanillaRouter({\n    type: \"history\",\n    routes: {\n        \"/\": \"home\",\n        \"/about\": \"about\",\n        \"/products\": \"products\"\n    }\n}).listen().on(\"route\", e =\u003e {\n    \n    // console.log(e.detail.route, e.detail.url);\n\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvneerven%2Fvanillarouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvneerven%2Fvanillarouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvneerven%2Fvanillarouter/lists"}