{"id":16625726,"url":"https://github.com/aleclarson/journey","last_synced_at":"2025-08-17T10:04:01.699Z","repository":{"id":66177792,"uuid":"119182979","full_name":"aleclarson/journey","owner":"aleclarson","description":"Client-side routing","archived":false,"fork":false,"pushed_at":"2018-12-05T16:55:14.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T12:33:48.614Z","etag":null,"topics":[],"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/aleclarson.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-27T16:51:00.000Z","updated_at":"2018-05-12T00:13:36.000Z","dependencies_parsed_at":"2023-02-20T17:46:00.852Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/journey","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/journey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fjourney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fjourney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fjourney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fjourney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/journey/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fjourney/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270831768,"owners_count":24653412,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12T04:06:58.901Z","updated_at":"2025-08-17T10:04:01.684Z","avatar_url":"https://github.com/aleclarson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# journey v2.0.0\n\nBrowser navigation enhanced.\n\n- Timestamps\n- Hard-reload detection\n- Useful events: `back`, `forward`, `push`, `set`\n\n### observe(function)\n\nGet notified about navigation events.\n\n- `back` the user went back 1+ times in history using native controls\n- `forward` the user went forward 1+ times in history using native controls\n- `push` your code called the `push` method\n- `set` your code called the `set` method\n\nYou must call `observe` only once. Within the observer, you can choose to\nemit to many listeners or do everything you need from a single module.\n\nThe observer is called asynchronously, and is passed the `state` object.\n\n### push(path: string, state: ?object)\n\nVisit the given path.\n\nUnder the hood, this calls the `history.pushState` method.\n\nThe `path` argument must begin with `/` if you want to change the entire path.\nOtherwise, you will visit a path relative to the current path. This works for\n`#hash`, `?query`, and `subpath` strings. For example, if the current path is\n`/foo`, the previous strings navigate to `/foo#hash`, `/foo?query`, and `/foo/subpath`.\n\n### set(path: string, state: ?object)\n\nChange the path by overwriting the current point in history.\n\nThe optional `state` will override the current state entirely.\n\nUnder the hood, this calls the `history.replaceState` method.\n\n### back()\n\nShortcut to `history.back`\n\n### forward()\n\nShortcut to `history.forward`\n\n### get()\n\nReturns the cached result of `location.pathname + location.hash + location.search`\n\n### is(string)\n\nShorthand for `journey.get() === \"/path/\"`\n\n### emit(id: string)\n\n### chain: object[]\n\nThe array of \"path states\" visited in the current session.\n\n### index: number\n\nThe current position in the `chain` array.\n\n### state: object\n\nThe current \"path state\", which is guaranteed to have the following properties:\n\n- `session: number` when the current session began\n- `time: number` when this path state was created\n- `title: string` the value of `document.title`\n\nYou can store anything JSON-compatible in this object, but you should use the\n`push` or `set` methods to do that. If you want to replace the entire state\nwithout changing the path, setting this property is the easiest way.\n\n### title: string\n\nShortcut to `document.title`\n\nYou should set this property instead of setting `document.title` directly\nso the history can be properly updated.\n\n### origin: string\n\nThe first path in the current session.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fjourney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Fjourney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fjourney/lists"}