{"id":26244001,"url":"https://github.com/shystruk/setintervaljs","last_synced_at":"2025-04-23T14:34:35.886Z","repository":{"id":48020480,"uuid":"112488192","full_name":"shystruk/SetIntervalJS","owner":"shystruk","description":"⏰ start and clear interval without setting a variable, clear interval anywhere you want","archived":false,"fork":false,"pushed_at":"2023-04-19T14:32:24.000Z","size":756,"stargazers_count":33,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T05:43:32.298Z","etag":null,"topics":["clearinterval","interval","javascript","setinterval"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/set-interval","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/shystruk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-11-29T14:51:33.000Z","updated_at":"2024-02-25T18:47:29.000Z","dependencies_parsed_at":"2024-06-18T17:07:31.279Z","dependency_job_id":"fdf02d48-8540-4a71-9c85-709a5b044076","html_url":"https://github.com/shystruk/SetIntervalJS","commit_stats":{"total_commits":55,"total_committers":4,"mean_commits":13.75,"dds":0.6909090909090909,"last_synced_commit":"3c8d8ac33003a1051098384ed0071f7733d35caa"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2FSetIntervalJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2FSetIntervalJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2FSetIntervalJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2FSetIntervalJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shystruk","download_url":"https://codeload.github.com/shystruk/SetIntervalJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250452698,"owners_count":21433071,"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":["clearinterval","interval","javascript","setinterval"],"created_at":"2025-03-13T10:38:40.653Z","updated_at":"2025-04-23T14:34:35.866Z","avatar_url":"https://github.com/shystruk.png","language":"JavaScript","readme":"# SetIntervalJS [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?hashtags=javascript\u0026original_referer=https%3A%2F%2Fpublish.twitter.com%2F\u0026ref_src=twsrc%5Etfw\u0026text=No%20more%20variable%20needed%20for%20clearInterval()%20%F0%9F%91%8C%F0%9F%98%80\u0026tw_p=tweetbutton\u0026url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fset-interval\u0026via=shystrukk) #\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) [![Build Status](https://travis-ci.org/shystruk/SetIntervalJS.svg?branch=master)](https://travis-ci.org/shystruk/SetIntervalJS) [![npm version](https://badge.fury.io/js/set-interval.svg)](https://badge.fury.io/js/set-interval) [![Known Vulnerabilities](https://snyk.io/test/github/shystruk/SetIntervalJS/badge.svg?targetFile=package.json)](https://snyk.io/test/github/shystruk/SetIntervalJS?targetFile=package.json)\n\nSetIntervalJS is a constructor which hide inside reference to setInterval() for cleaner usage. It helps to make your code cleaner and there is no need to have more variables for clearInterval() and you can clear interval anywhere you want👌.\n\n## Getting SetIntervalJS ##\n#### npm\n`npm install --save set-interval`\n\n#### yarn\n`yarn add set-interval --save`\n\n## Examples ##\n```javascript\nSetInterval.start(function, milliseconds, key_string)\n```\n\n### Basic example ###\n```javascript\nimport SetInterval from 'set-interval'\n\nSetInterval.start(callback, 1000, 'test')\nSetInterval.clear('test')\n```\n\n### Multiple instances ###\n```javascript\n// -\u003e ./start.js\nimport SetInterval from 'set-interval'\n\nSetInterval.start(callback, 1000, 'test')\nSetInterval.start(callback_2, 1000, 'test_2')\nSetInterval.start(callback_3, 1000, 'test_3')\n\n\n// -\u003e ./clear.js\nimport SetInterval from 'set-interval'\n\nSetInterval.clear('test')\nSetInterval.clear('test_2')\nSetInterval.clear('test_3')\n```\n\n\n## API ##\n### SetInterval.start(callback, milliseconds, key_string) ###\n\n#### callback ####\nType: `function` \u003cbr\u003e\nFunction that gets called in each milliseconds interval\n\n#### milliseconds ####\nType: `number` \u003cbr\u003e\nInterval time in which callback function gets called\n\n#### key_string ####\nType: `string` \u003cbr\u003e\nKey name for which interval will be referenced\n\n\n### SetInterval.clear(key_string) ###\n#### key_string ####\nType: `string` \u003cbr\u003e\nKey name which was passed to .start method\n\n\n## Contributing\n\nAny contributions you make **are greatly appreciated**.\n\nPlease read the [Contributions Guidelines](CONTRIBUTING.md) before submitting a PR.\n\n## License\n\nMIT © [Vasyl Stokolosa](https://about.me/shystruk)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshystruk%2Fsetintervaljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshystruk%2Fsetintervaljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshystruk%2Fsetintervaljs/lists"}