{"id":16625570,"url":"https://github.com/aleclarson/spy-on","last_synced_at":"2026-04-15T11:31:10.597Z","repository":{"id":56218545,"uuid":"314377876","full_name":"aleclarson/spy-on","owner":"aleclarson","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-19T22:43:22.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T23:27:20.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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}},"created_at":"2020-11-19T21:47:56.000Z","updated_at":"2020-11-20T00:37:45.000Z","dependencies_parsed_at":"2022-08-15T14:50:50.029Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/spy-on","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/spy-on","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fspy-on","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fspy-on/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fspy-on/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fspy-on/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/spy-on/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fspy-on/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31839200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T11:29:19.690Z","status":"ssl_error","status_checked_at":"2026-04-15T11:29:19.171Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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:12.636Z","updated_at":"2026-04-15T11:31:10.571Z","avatar_url":"https://github.com/aleclarson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @alloc/spy-on\n\nObserve assignments to any writable, configurable object property.\n\n```js\nimport spyOn from '@alloc/spy-on'\n\nconst obj = { a: 0 }\n\n// The same property can be spied on multiple times.\nconst logger = spyOn(obj, 'a', console.log)\nconst mirror = spyOn(obj, 'a', a =\u003e (obj.b = a))\n\nobj.a++        // logs \"1\"\nobj.a == obj.b // =\u003e true\n\n// Spies can be disposed.\nlogger.dispose()\nobj.a++        // logs nothing\nobj.a == obj.b // =\u003e true\n\nmirror.dispose()\nobj.a++        // logs nothing\nobj.a == obj.b // =\u003e false\n\n// Once all spies are disposed, the original descriptor \n// is restored.\nObject.defineProperty(obj, 'a').value == 3 // =\u003e true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fspy-on","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Fspy-on","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fspy-on/lists"}