{"id":27639501,"url":"https://github.com/fabiospampinato/isotimer","last_synced_at":"2025-08-02T13:38:49.478Z","repository":{"id":274380791,"uuid":"922723493","full_name":"fabiospampinato/isotimer","owner":"fabiospampinato","description":"An isomorphic setImmediate/setInterval/setTimeout implementation.","archived":false,"fork":false,"pushed_at":"2025-01-26T23:25:29.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T22:17:22.734Z","etag":null,"topics":["interval","isomorphic","ref","timeout","timer","unref"],"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/fabiospampinato.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},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2025-01-26T23:23:59.000Z","updated_at":"2025-01-28T04:59:21.000Z","dependencies_parsed_at":"2025-01-27T00:23:27.700Z","dependency_job_id":"92b2d962-1f6c-44af-82b3-e6a4d52319ed","html_url":"https://github.com/fabiospampinato/isotimer","commit_stats":null,"previous_names":["fabiospampinato/isotimer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fisotimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fisotimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fisotimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fisotimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/isotimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522296,"owners_count":21444512,"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":["interval","isomorphic","ref","timeout","timer","unref"],"created_at":"2025-04-23T22:17:27.294Z","updated_at":"2025-04-23T22:17:27.975Z","avatar_url":"https://github.com/fabiospampinato.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"# IsoTimer\n\nAn isomorphic setImmediate/setInterval/setTimeout implementation.\n\nThis package exists to smooth out differences between Node and the browser, and to clean up some nonsense.\n\n## Features\n\n- This library works everywhere, with the same API.\n- setTimeout/setInterval don't return numbers under Node, this library eliminates that ugliness.\n- setImmediate is not natively available in the browser, this library polyfills it.\n- setImmediate will also return a number, for consistency.\n- .ref/.unref methods are not browser functions, this library exposes dedicated functions for them.\n- If the number of milliseconds is too high it would [overflow](https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#maximum_delay_value), this library clamps it within the supported range.\n\n## Install\n\n```sh\nnpm install isotimer\n```\n\n## Usage\n\nVery similar APIs are available for setImmediate/setInterval/setTimeout.\n\nThe following code will just look at timeouts, for convenience, but they all work the same way basically.\n\n```ts\nimport {setImmediate, clearImmediate, refImmediate, unrefImmediate} from 'isotimer';\nimport {setInterval, clearInterval, refInterval, unrefInterval} from 'isotimer';\nimport {setTimeout, clearTimeout, refTimeout, unrefTimeout} from 'isotimer';\n\n// Let's schedule a timeout, which will always return us a number\n\nconst timeoutId = setTimeout ( () =\u003e {\n  console.log ( 'Hello' );\n}, 1000 );\n\n// Let's unref and ref it back again, just to show how to do it\n\nunrefTimeout ( timeoutId );\nrefTimeout ( timeoutId );\n\n// Let's clear it\n\nclearTimeout ( timeoutId );\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fisotimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fisotimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fisotimer/lists"}