{"id":22707512,"url":"https://github.com/mattzeunert/object-history-debugger","last_synced_at":"2025-04-13T12:31:57.147Z","repository":{"id":57312614,"uuid":"78107299","full_name":"mattzeunert/Object-History-Debugger","owner":"mattzeunert","description":"See where an object's property values were assigned, plus a history of past values.","archived":false,"fork":false,"pushed_at":"2017-05-20T14:09:33.000Z","size":2567,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T03:35:13.652Z","etag":null,"topics":["debugger","debugging","dynamic-analysis"],"latest_commit_sha":null,"homepage":"http://www.mattzeunert.com/Object-History-Debugger/demo/index.html","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/mattzeunert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-05T11:28:07.000Z","updated_at":"2024-05-27T20:04:41.000Z","dependencies_parsed_at":"2022-08-31T10:23:44.028Z","dependency_job_id":null,"html_url":"https://github.com/mattzeunert/Object-History-Debugger","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/mattzeunert%2FObject-History-Debugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattzeunert%2FObject-History-Debugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattzeunert%2FObject-History-Debugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattzeunert%2FObject-History-Debugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattzeunert","download_url":"https://codeload.github.com/mattzeunert/Object-History-Debugger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714598,"owners_count":21149923,"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":["debugger","debugging","dynamic-analysis"],"created_at":"2024-12-10T10:13:14.482Z","updated_at":"2025-04-13T12:31:57.108Z","avatar_url":"https://github.com/mattzeunert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Object History Debugger [![CircleCI](https://circleci.com/gh/mattzeunert/Object-History-Debugger.svg?style=svg)](https://circleci.com/gh/mattzeunert/Object-History-Debugger)\n\nSee where an object's property values were assigned, plus a history of past values.\n\n[Demo Page](http://www.mattzeunert.com/Object-History-Debugger/demo/index.html)\n\n![](https://cloud.githubusercontent.com/assets/1303660/21923127/33283af2-d96a-11e6-96e0-df9cbb42550f.png)\n\n![](https://cloud.githubusercontent.com/assets/1303660/21923131/377ca912-d96a-11e6-8895-d92e9b227e1d.png)\n\n## Setup\n\n### Add a plugin to your babel build\n\n1. `npm install object-history-debugger`\n2. Add `object-history-debugger/babel-plugin` to your Babel plugins, e.g. in .babelrc\n3. Put `import ohd from \"object-history-debugger\"` before any of your own JS code.\n4. Make sure your build has source maps enabled, if you want to use prettyPrint\n5. Build your project and load it as usual. Objects now have `__history__` values for each property.\n\nPretty printing the history currently only works in Chrome.\n\nIf you're excluding paths from your Babel build (e.g. the `node_modules` folder) assignments in those files won't be tracked.\n\n### Chrome extension: easy setup, but flaky\n\n[Install the Chrome extension](https://chrome.google.com/webstore/detail/object-history-debugger/hmnmphiibikkcahffmpkadbibhokagho/related) then click the icon next to the URL bar to reload the current page with object tracking enabled.\n\nThe Chrome extension is quite hacky and some pages will break when Object History Debugger is activated.\n\n## Usage\n\nYou can either inspect the property's history in a debugger or call `prettyPrint` on the history property.\n\nFor example, if your property name is `sth` you would call `obj.sth__history__.prettyPrint()`.\n\nPretty print shows you the original source code you wrote. Because it's asynchronous it won't log the history right away if you're paused in the debugger.\n\nTo see the history without having to resume execution call `prettyPrintSynchronously`.\n\n\n### Tracking only specific objects to save memory\n\nTracking all past property values can use up a lot of memory. Chrome can't garbage collect values if they are still referenced in a `__history__` value.\n\nTo only track assignments on certain objects set `trackAllObjects` to false:\n\n    import ohd from \"object-history-debugger\"\n    ohd.trackAllObjects = false;\n\nThen, to track assignments on `obj`:\n\n    ohd.trackObject(obj)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattzeunert%2Fobject-history-debugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattzeunert%2Fobject-history-debugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattzeunert%2Fobject-history-debugger/lists"}