{"id":15654620,"url":"https://github.com/jaydenseric/next-router-events","last_synced_at":"2025-05-01T02:51:29.164Z","repository":{"id":66026753,"uuid":"107348212","full_name":"jaydenseric/next-router-events","owner":"jaydenseric","description":"A more powerful Next.js router events API.","archived":false,"fork":false,"pushed_at":"2018-12-04T22:21:51.000Z","size":12,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T18:50:25.293Z","etag":null,"topics":["nextjs"],"latest_commit_sha":null,"homepage":"https://npm.im/next-router-events","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/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-18T02:21:27.000Z","updated_at":"2022-08-28T06:34:36.000Z","dependencies_parsed_at":"2023-02-20T19:30:36.908Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/next-router-events","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fnext-router-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fnext-router-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fnext-router-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fnext-router-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/next-router-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251815442,"owners_count":21648367,"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":["nextjs"],"created_at":"2024-10-03T12:52:53.200Z","updated_at":"2025-05-01T02:51:29.146Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-router-events\n\n[![Build status](https://travis-ci.org/jaydenseric/next-router-events.svg)](https://travis-ci.org/jaydenseric/next-router-events) [![npm version](https://img.shields.io/npm/v/next-router-events.svg)](https://npm.im/next-router-events)\n\nA more powerful Next.js router events API. The standard API can only handle one listener per router event (see [zeit/next.js#2033](https://github.com/zeit/next.js/issues/2033)).\n\n## Setup\n\nTo install [`next-router-events`](https://npm.im/next-router-events) from [npm](https://npmjs.com) run:\n\n```\nnpm install next-router-events\n```\n\n## Usage\n\nTo use router events:\n\n```js\nimport routerEvents from 'next-router-events'\n\nconst logUrl = url =\u003e console.log(url)\nconst alertUrl = url =\u003e alert(url)\n\nrouterEvents.on('routeChangeComplete', logUrl)\nrouterEvents.once('routeChangeComplete', alertUrl)\nrouterEvents.off('routeChangeComplete', logUrl)\n```\n\nSee `next` [router events](https://github.com/zeit/next.js#router-events) and `tiny-emitter` [instance methods](https://github.com/scottcorgan/tiny-emitter#instance-methods).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fnext-router-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fnext-router-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fnext-router-events/lists"}