{"id":19375971,"url":"https://github.com/ftonato/set-interval-manager","last_synced_at":"2025-08-08T05:12:12.865Z","repository":{"id":158476619,"uuid":"634049430","full_name":"ftonato/set-interval-manager","owner":"ftonato","description":"A simple utility for managing intervals without having to manually track interval IDs. Easily start and stop intervals using a unique identifier.","archived":false,"fork":false,"pushed_at":"2023-05-20T01:43:51.000Z","size":171,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-07T21:25:30.154Z","etag":null,"topics":["clearinterval","interval","interval-manager","setinterval","timer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/set-interval-manager","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/ftonato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ftonato"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-04-28T22:48:32.000Z","updated_at":"2023-06-12T13:57:09.000Z","dependencies_parsed_at":"2024-11-10T08:41:06.126Z","dependency_job_id":"e9b16c13-1e3f-48e7-bd67-945d80079f0d","html_url":"https://github.com/ftonato/set-interval-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ftonato/set-interval-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fset-interval-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fset-interval-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fset-interval-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fset-interval-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftonato","download_url":"https://codeload.github.com/ftonato/set-interval-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fset-interval-manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269366853,"owners_count":24405250,"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-08T02:00:09.200Z","response_time":72,"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":["clearinterval","interval","interval-manager","setinterval","timer"],"created_at":"2024-11-10T08:40:57.745Z","updated_at":"2025-08-08T05:12:12.840Z","avatar_url":"https://github.com/ftonato.png","language":"TypeScript","readme":"# set-interval-manager\n\n[![npm version](https://img.shields.io/npm/v/set-interval-manager.svg)](https://www.npmjs.com/package/set-interval-manager)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ftonato/set-interval-manager/blob/main/LICENSE)\n\nA utility class for managing intervals created by `setInterval`.\n\n## Installation\n\nYou can install the package using npm:\n\n```bash\nnpm install set-interval-manager\n```\n\n## Examples\n\n```js\n// ES6 import\nimport SetInterval from 'set-interval-manager';\n\n// (or) CommonJS require\nconst SetInterval = require('set-interval-manager');\n\n\nconst mockFn = () =\u003e 'set-interval-manager';\n\n// --- (start + clear) ---\n\nSetInterval.start(mockFn, 1000, 'basic-example');\n\nSetInterval.clear('basic-example');\n\n// --- (start + clearAll) ---\n\nSetInterval.start(mockFn, 1000, 'interval-one');\nSetInterval.start(mockFn, 1500, 'interval-two');\nSetInterval.start(mockFn, 2000, 'interval-three');\n\nSetInterval.clearAll();\n\n// --- (start + listAll) ---\n\nSetInterval.start(mockFn, 1000, 'interval-one');\nSetInterval.start(mockFn, 1500, 'interval-two');\n\nSetInterval.listAll(); // =\u003e ['interval-one', 'interval-two']\n\nSetInterval.clear('interval-one');\n\nSetInterval.listAll(); // =\u003e ['interval-two']\n```\n\n----\n\n## API\n\n### `SetInterval`\n\nThe main class exported by the package.\n\n#### `start(fn: IntervalFn, interval: number, key: string): void`\n\nStarts a new interval that calls the specified function at the specified interval.\n\n- `fn` (required): The function to call.\n- `interval` (required): The interval (in milliseconds) at which to call the function.\n- `key` (required): A unique string identifier for the interval.\n\n#### `clear(key: string): void`\n\nStops the interval with the specified key.\n\n- `key` (required): The string identifier for the interval to stop.\n\n#### `clearAll(): void`\n\nStops all intervals managed by this utility.\n\n#### `listAll(): string[]`\n\nGets an array of all keys currently being used to manage intervals.\n\n----\n\n## License\n\nThis package is released under the [MIT License](https://github.com/ftonato/set-interval-manager/blob/main/LICENSE).","funding_links":["https://github.com/sponsors/ftonato"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftonato%2Fset-interval-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftonato%2Fset-interval-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftonato%2Fset-interval-manager/lists"}