{"id":21008998,"url":"https://github.com/avin/repeat","last_synced_at":"2025-12-29T23:44:04.041Z","repository":{"id":57099986,"uuid":"164440673","full_name":"avin/repeat","owner":"avin","description":"Make repeat actions easily.","archived":false,"fork":false,"pushed_at":"2019-01-17T07:44:03.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-20T17:09:44.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/avin.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":"2019-01-07T14:00:02.000Z","updated_at":"2019-01-17T07:44:04.000Z","dependencies_parsed_at":"2022-08-22T23:10:42.985Z","dependency_job_id":null,"html_url":"https://github.com/avin/repeat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Frepeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Frepeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Frepeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avin%2Frepeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avin","download_url":"https://codeload.github.com/avin/repeat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243430541,"owners_count":20289745,"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-11-19T09:15:04.185Z","updated_at":"2025-12-29T23:44:03.992Z","avatar_url":"https://github.com/avin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @avinlab/repeat ![build](https://travis-ci.org/avin/repeat.svg?branch=master)\n\n\u003e Make repeat actions easily.\n\n## Install\n\n```bash\n# Yarn\nyarn add @avinlab/repeat\n\n# NPM\nnpm install --save @avinlab/repeat\n```\n\n## Usage\n\n```js\nimport repeat from '@avinlab/repeat';\n\nconst repeatAction = repeat({\n    action: counter =\u003e {\n        console.log(counter);\n    },\n    delay: 500,\n    firstTimeDelay: 1000,\n    skipFirst: true,\n});\n\n// Start interval actions\nrepeatAction.start();\n\n// Stop interval actions\nrepeatAction.stop();\n```\n\n## API\n\n### Options\n\n* `action` _(Function)_ - Interval function. Params: `counter` - call action index number.\n* `delay` _(Number)_ - Sleep time in ms between actions.\n* `firstTimeDelay` _(Number)_ - First time sleep period in ms.\n* `skipFirst` _(Boolean)_ - Skip first time action call.\n* `times` _(Number)_ - Repeat N times.\n\n### Methods\n\n* `start()` - Start repeat actions.\n* `stop()` - Stop repeat actions.\n* `pause()` - Pause repeat actions (without reset counter and don't touch firstTimeRun flag).\n* `resume()` - Resume repeating after pause.\n* `updateDelay(newDelay)` - Update option delay value without restart (update with next tick).\n\n## License\n\nMIT © [avin](https://github.com/avin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Frepeat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favin%2Frepeat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favin%2Frepeat/lists"}