{"id":15979107,"url":"https://github.com/perry-mitchell/custom-interval","last_synced_at":"2025-11-13T02:02:15.406Z","repository":{"id":74696219,"uuid":"161212423","full_name":"perry-mitchell/custom-interval","owner":"perry-mitchell","description":"Customisable setInterval with variating delay","archived":false,"fork":false,"pushed_at":"2018-12-10T20:54:14.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T00:03:23.236Z","etag":null,"topics":["setinterval","settimeout","timer"],"latest_commit_sha":null,"homepage":null,"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/perry-mitchell.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":"2018-12-10T17:34:31.000Z","updated_at":"2018-12-10T20:53:00.000Z","dependencies_parsed_at":"2023-02-25T07:45:23.050Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/custom-interval","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"0152cb8a1e5acb497d0d29cda9b4f7fe75879045"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcustom-interval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcustom-interval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcustom-interval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fcustom-interval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/custom-interval/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240215647,"owners_count":19766450,"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":["setinterval","settimeout","timer"],"created_at":"2024-10-07T23:41:12.516Z","updated_at":"2025-11-13T02:02:15.320Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","readme":"# Custom-Interval\n\u003e Customisable setInterval with variating delay and immediate execution (optional)\n\n[![Build Status](https://travis-ci.org/perry-mitchell/custom-interval.svg?branch=master)](https://travis-ci.org/perry-mitchell/custom-interval)\n\n`npm install custom-interval --save`\n\n## Usage\n\nCustom-Interval provides a `setInterval`-like API to set and clear custom intervals using `setCustomInterval` and `clearCustomInterval`. These intervals can be used just like the standard `setInterval`, but also come packed with the ability to have custom-stepping on delays:\n\n```javascript\nconst { clearCustomInterval, setCustomInterval } = require(\"custom-interval\");\n\nconst interval = setCustomInterval(() =\u003e console.log(\"Fire!\"), [\n    100,\n    150,\n    \"2x300\",\n    500\n]);\n\n// Later:\nclearCustomInterval(interval);\n```\n\n_In this example the callback is executed at a **custom interval** where the execution times are 100, 150, 300, 300 and then 500 (repeating)._\n\nCustom intervals can also fire on the leading edge (immediate execution, but asynchronous):\n\n```javascript\nsetCustomInterval(callback, 2000, { immediate: true });\n```\n\nCheck out the [API documentation](API.md) for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fcustom-interval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Fcustom-interval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fcustom-interval/lists"}