{"id":16771367,"url":"https://github.com/odsod/foreach-batch","last_synced_at":"2025-03-16T16:18:59.582Z","repository":{"id":14869690,"uuid":"17593147","full_name":"odsod/foreach-batch","owner":"odsod","description":"Batch processing that keeps the UI responsive. Browserifyable.","archived":false,"fork":false,"pushed_at":"2014-04-05T10:43:47.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T03:16:13.038Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/odsod.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}},"created_at":"2014-03-10T13:19:22.000Z","updated_at":"2014-04-05T10:43:47.000Z","dependencies_parsed_at":"2022-09-05T22:00:15.270Z","dependency_job_id":null,"html_url":"https://github.com/odsod/foreach-batch","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/odsod%2Fforeach-batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odsod%2Fforeach-batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odsod%2Fforeach-batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odsod%2Fforeach-batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odsod","download_url":"https://codeload.github.com/odsod/foreach-batch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893902,"owners_count":20364919,"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-10-13T06:27:45.704Z","updated_at":"2025-03-16T16:18:59.549Z","avatar_url":"https://github.com/odsod.png","language":"JavaScript","readme":"forEachBatch\n============\n\n[![Build Status](https://travis-ci.org/odsod/foreach-batch.svg)](https://travis-ci.org/odsod/foreach-batch)\n\nA simple combinator for deferred batch processing to keep the UI responsive under long-running\ncomputations.\n\nSyntax\n------\n\n```\nforEach(arr, callback, batchSize[, progressCallback[, timeoutDelay])\n```\n\nDescription\n-----------\n\nI wrote this to build a big [Lunr.js](https://github.com/olivernn/lunr.js) search index without\nblocking the UI and without using WebWorkers.\n\n```javascript\nvar forEachBatch = require('foreach-batch');\n\n// Process everything at once - will possibly block the UI\nstuff.forEach(someExpensiveFunction);\n\n// Process in batches of 10 - giving the UI some breathing room in between batches\nforEachBatch(stuff, someExpensiveFunction, 10, function(progress) {\n  console.log(progress); // ...and we can keep track of our progress\n}, 1000); // ...and we can control how long to wait between batches\n```\n\nInstallation\n------------\n\n```\nnpm install foreach-batch\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodsod%2Fforeach-batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodsod%2Fforeach-batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodsod%2Fforeach-batch/lists"}