{"id":17419742,"url":"https://github.com/bendrucker/observ-history","last_synced_at":"2025-07-21T04:31:51.387Z","repository":{"id":57313046,"uuid":"43088960","full_name":"bendrucker/observ-history","owner":"bendrucker","description":"Observable interface to the browser history API","archived":false,"fork":false,"pushed_at":"2019-08-19T21:59:21.000Z","size":9,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-20T06:49:00.709Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendrucker.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-09-24T19:42:41.000Z","updated_at":"2019-07-12T17:07:35.000Z","dependencies_parsed_at":"2022-09-20T23:30:15.557Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/observ-history","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/bendrucker%2Fobserv-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fobserv-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fobserv-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fobserv-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/observ-history/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226867825,"owners_count":17694818,"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-17T02:31:40.692Z","updated_at":"2024-11-28T06:16:33.510Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# observ-history [![Build Status](https://travis-ci.org/bendrucker/observ-history.svg?branch=master)](https://travis-ci.org/bendrucker/observ-history) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/observ-history.svg)](https://greenkeeper.io/)\n\n\u003e Observable interface to the browser history API\n\n\n## Install\n\n```\n$ npm install --save observ-history\n```\n\n\n## Usage\n\n```js\nvar history = require('observ-history')\n\nhistory(function (path) {\n  //=\u003e (popstate)  \n})\n\nhistory()\n//=\u003e current path\n\nhistory.set(path)\n//=\u003e pushState\n```\n\n## API\n\n#### `history([listener])` -\u003e `function`\n\nReturns an unlisten function.\n\n##### listener\n\nType: `function`\n\nA function to call with the current path when the history changes and a [`popstate` event](https://developer.mozilla.org/en-US/docs/Web/Events/popstate) is fired. If no function is passed, the current path is returned.\n\n#### `history.set(path)` -\u003e `undefined`\n\nUpdates the history by calling [`pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState).\n\n\n## License\n\nMIT © [Ben Drucker](http://bendrucker.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fobserv-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fobserv-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fobserv-history/lists"}