{"id":18024015,"url":"https://github.com/lete114/worker-tick","last_synced_at":"2025-04-04T18:27:33.469Z","repository":{"id":236042441,"uuid":"791309736","full_name":"Lete114/worker-tick","owner":"Lete114","description":"Make setTimeout() and setInterval() timers work stably in background tabs (unfocused browser tabs)","archived":false,"fork":false,"pushed_at":"2024-04-29T10:47:37.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T03:42:52.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Lete114.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-24T13:39:52.000Z","updated_at":"2024-07-23T15:25:30.000Z","dependencies_parsed_at":"2024-04-25T12:32:04.314Z","dependency_job_id":"bb994e05-5400-49bf-98a3-e817e808d69d","html_url":"https://github.com/Lete114/worker-tick","commit_stats":null,"previous_names":["lete114/worker-tick"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fworker-tick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fworker-tick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fworker-tick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lete114%2Fworker-tick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lete114","download_url":"https://codeload.github.com/Lete114/worker-tick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247228195,"owners_count":20904825,"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-30T07:11:40.156Z","updated_at":"2025-04-04T18:27:33.438Z","avatar_url":"https://github.com/Lete114.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# worker-tick\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![bundle][bundle-src]][bundle-href]\n[![JSDocs][jsdocs-src]][jsdocs-href]\n[![License][license-src]][license-href]\n\nMake setTimeout() and setInterval() timers work stably in background tabs (unfocused browser tabs)\n\nBrowsers reduce the frequency of setTimeout() and setInterval() when a browser tab is inactive (e.g., loses focus, switches to another tab, or switches to another application) for performance optimization reasons requestAnimationFrame() does the same thing\n\n## Install\n\nUsing npm:\n\n```bash\nnpm install worker-tick\n```\n\n## Usage\n\nRefer to [development](https://github.com/Lete114/worker-tick/blob/main/development/index.ts) in the repository\n\n```diff\nimport workerTick from 'worker-tick'\n\n- window.setInterval(console.log, 1000, 1, 2, 3)\n+ workerTick.setInterval(console.log, 1000, 1, 2, 3)\n// =\u003e Printouts per second: 1 2 3\n\n// clear\nconst timerId = workerTick.setInterval(console.log, 1000, 1, 2, 3)\nworkerTick.clearInterval(timerId)\n\n// setTimeout() Same as above\n```\n\n## License\n\n[MIT](./LICENSE) License © 2024-PRESENT [Lete114](https://github.com/lete114)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/worker-tick?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-version-href]: https://npmjs.com/package/worker-tick\n[npm-downloads-src]: https://img.shields.io/npm/dm/worker-tick?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-downloads-href]: https://npmjs.com/package/worker-tick\n[bundle-src]: https://img.shields.io/bundlephobia/minzip/worker-tick?style=flat\u0026colorA=080f12\u0026colorB=1fa669\u0026label=minzip\n[bundle-href]: https://bundlephobia.com/result?p=worker-tick\n[license-src]: https://img.shields.io/github/license/lete114/worker-tick.svg?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[license-href]: https://github.com/lete114/worker-tick/blob/main/LICENSE\n[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[jsdocs-href]: https://www.jsdocs.io/package/worker-tick\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fworker-tick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flete114%2Fworker-tick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flete114%2Fworker-tick/lists"}