{"id":18327198,"url":"https://github.com/dalikewara/vcmloop","last_synced_at":"2025-09-18T00:57:17.537Z","repository":{"id":57391123,"uuid":"169945630","full_name":"dalikewara/vcmloop","owner":"dalikewara","description":"An interval-based looping method","archived":false,"fork":false,"pushed_at":"2022-08-29T18:05:53.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T12:53:43.446Z","etag":null,"topics":["helper","interval","javascript","looping","tool","toolkit","vascomm"],"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/dalikewara.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":"dalikewara","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":"2019-02-10T05:18:23.000Z","updated_at":"2022-02-17T14:34:39.000Z","dependencies_parsed_at":"2022-09-19T05:42:02.024Z","dependency_job_id":null,"html_url":"https://github.com/dalikewara/vcmloop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dalikewara/vcmloop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalikewara%2Fvcmloop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalikewara%2Fvcmloop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalikewara%2Fvcmloop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalikewara%2Fvcmloop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalikewara","download_url":"https://codeload.github.com/dalikewara/vcmloop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalikewara%2Fvcmloop/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264089588,"owners_count":23555765,"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":["helper","interval","javascript","looping","tool","toolkit","vascomm"],"created_at":"2024-11-05T19:09:55.414Z","updated_at":"2025-09-18T00:57:12.444Z","avatar_url":"https://github.com/dalikewara.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dalikewara"],"categories":[],"sub_categories":[],"readme":"[![npm package](https://nodei.co/npm/vcmloop.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/vcmloop/)\n\n[![version](https://img.shields.io/npm/v/vcmloop.svg?style=flat)](https://img.shields.io/npm/v/vcmloop.svg?style=flat)\n[![build](https://img.shields.io/circleci/project/github/dalikewara/vcmloop.svg?style=flat)](https://img.shields.io/circleci/project/github/dalikewara/vcmloop.svg?style=flat)\n[![language](https://img.shields.io/github/languages/top/dalikewara/vcmloop.svg?style=flat)](https://img.shields.io/github/languages/top/dalikewara/vcmloop.svg?style=flat)\n[![download](https://img.shields.io/npm/dt/vcmloop.svg?style=flat)](https://img.shields.io/npm/dt/vcmloop.svg?style=flat)\n[![dependents](https://img.shields.io/librariesio/dependents/npm/vcmloop.svg?style=flat)](https://img.shields.io/librariesio/dependents/npm/vcmloop.svg?style=flat)\n[![issue](https://img.shields.io/github/issues/dalikewara/vcmloop.svg?style=flat)](https://img.shields.io/github/issues/dalikewara/vcmloop.svg?style=flat)\n[![last_commit](https://img.shields.io/github/last-commit/dalikewara/vcmloop.svg?style=flat)](https://img.shields.io/github/last-commit/dalikewara/vcmloop.svg?style=flat)\n[![license](https://img.shields.io/npm/l/vcmloop.svg?style=flat)](https://img.shields.io/npm/l/vcmloop.svg?style=flat)\n\n# An interval-based looping method for massive data\nDoing simple looping basicly doesn't have big impact to your RAM/CPU resource, but, it will if you performing heavy looping with massive data, for example 100k data or \u003e 1m data.\n\nDefault looping method like `for`, `while`, `foreach` runs faster (has better performance), but also takes and spent more RAM/CPU resource continously along with the looping process\u0026mdash;if you own more resource, I think it's not a big problem. Otherwise, using interval method doesn't harm RAM/CPU resource too much. It just uses a little bit of it and keeping the resource stable until the process is done. As a consequence, it runs slower than the default method\u0026mdash;but still fast.\n\nSo, if you need to do looping with massive data and heavy process inside, using interval method should be a better solution.\n\n### Installation\nNPM\n\n```console\nnpm install vcmloop --save\n```\n\nBrowser\n\n```js\n// Bower\nbower install vcmloop --save\n```\n\n### Initialization\nNPM\n\n```js\nconst vcmloop = require('vcmloop');\n```\n\nBrowser\n\n```js\n// Bower\n\u003cscript src=\"bower_components/vcmloop/dist/vcmloop.min.js\"\u003e\u003c/script\u003e\n```\n\n# Quickstart\n\n```js\nvcmloop(start, stop, fn, end[optional], delay[optional]);\n```\n\n- Arguments\n  - *number* **start**\n  - *number* **stop**\n  - *function* **fn**\n  - *function* **end** [optional]\n  - *number* **delay** [optional]\n    - *default* 0\n\nHere is basic `vcmloop` usage:\n\n```js\nvcmloop(0, 5, (num) =\u003e {\n  console.log(num);\n});\n```\n\nYou can pass an `end` argument to run once after the **synchronous** looping process is done.\n\n```js\nvcmloop(0, 5, (num) =\u003e {\n  console.log(num);\n}, () =\u003e {\n  console.log('end');\n});\n\n// output:\n// 0\n// 1\n// 2\n// 3\n// 4\n// end\n```\n\nYou can set duration or `delay` for interval process.\n\n```js\nvcmloop(0, 5, (num) =\u003e {\n  console.log(num);\n}, null, 200);\n```\n\n```js\nvcmloop(0, 5, (num) =\u003e {\n  console.log(num);\n}, () =\u003e {\n  console.log('end');\n}, 200);\n```\n\nYou may do this in an **asynchronous** looping process to make sure your code runs correctly:\n\n```js\nvar len = 10;\nvar lenX = len - 1;\nvar start = 0;\n\nvcmloop(start, len, (num) =\u003e {\n  console.log(num);\n  \n  sampleFunction(sampleCallback =\u003e {\n    if (num === lenX) return 'end';\n  });\n});\n```\n\n# Release\n\n### Changelog\nSee [https://github.com/dalikewara/vcmloop/blob/master/CHANGELOG.md](https://github.com/dalikewara/vcmloop/blob/master/CHANGELOG.md).\n\n### Credits\nCopyright \u0026copy; 2019 [Dali Kewara](https://www.dalikewara.com).\n\n### License\n[MIT License](https://github.com/dalikewara/vcmloop/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalikewara%2Fvcmloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalikewara%2Fvcmloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalikewara%2Fvcmloop/lists"}