{"id":19574686,"url":"https://github.com/stringparser/batch-these","last_synced_at":"2026-06-10T04:31:47.760Z","repository":{"id":21292165,"uuid":"24608248","full_name":"stringparser/batch-these","owner":"stringparser","description":"batch with ease","archived":false,"fork":false,"pushed_at":"2014-10-09T15:25:06.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T03:11:57.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stringparser.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-09-29T18:48:29.000Z","updated_at":"2014-12-23T00:54:24.000Z","dependencies_parsed_at":"2022-08-20T16:40:27.964Z","dependency_job_id":null,"html_url":"https://github.com/stringparser/batch-these","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stringparser/batch-these","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fbatch-these","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fbatch-these/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fbatch-these/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fbatch-these/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stringparser","download_url":"https://codeload.github.com/stringparser/batch-these/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fbatch-these/sbom","scorecard":{"id":855283,"data":{"date":"2025-08-11","repo":{"name":"github.com/stringparser/batch-these","commit":"c19e731339fa660429e5bb6be1face954323c015"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T23:45:15.312Z","repository_id":21292165,"created_at":"2025-08-23T23:45:15.312Z","updated_at":"2025-08-23T23:45:15.312Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11T06:43:25.539Z","updated_at":"2026-06-10T04:31:47.744Z","avatar_url":"https://github.com/stringparser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# batch-these [\u003cimg alt=\"progressed.io\" src=\"http://progressed.io/bar/75\" align=\"right\"/\u003e](https://github.com/fehmicansaglam/progressed.io)\n\n[\u003cimg alt=\"build\" src=\"http://img.shields.io/travis/stringparser/batch-these/master.svg?style=flat-square\" align=\"left\"/\u003e](https://travis-ci.org/stringparser/batch-these/builds)\n[\u003cimg alt=\"NPM version\" src=\"http://img.shields.io/npm/v/batch-these.svg?style=flat-square\" align=\"right\"/\u003e](http://www.npmjs.org/package/batch-these)\n\u003cbr\u003e\u003cbr\u003e\nbatch data with ease\n\u003cbr\u003e\n\n## install\n\n    npm install --save batch-these\n\n## example\n\n```js\nvar batch = require('batch-these');\n    batch.wait(10); // 10 miliseconds tops\n\nprocess.on('stuff-started', function(e){\n  var chunk = e.name;\n  batch.these(chunk, function(data){\n    console.log('Started ', data.join(', ') );\n  });\n});\n\nprocess.on('stuff-done', function(e){\n  var chunk = e.name + ' in ' + Math.floor(e.time) + ' ms';\n  batch.these(chunk, function(data){\n    console.log('Done with Mr.', data.join(', Mr. ') );\n  });\n});\n\nvar dogs = ['Blue', 'Pink', 'Eddie', 'Joe','White','Brown', 'Blonde','Orange'];\n\ndogs.forEach(function(name, index){\n  var time = process.hrtime();\n  setTimeout(function(){\n    process.emit('stuff-started', {\n      name : name,\n      time : time\n    });\n\n    var rand = Math.floor(Math.random()*100);\n    setTimeout(function(){\n      process.emit('stuff-done', {\n        name : name,\n        time : process.hrtime(time)[1]/1000000\n      });\n    }, rand);\n  }, (index + 1)*11);\n});\n\n```\nwhich will output something similar to\n\n```\nStarted  Blue, Pink, Eddie, Joe, White\nDone with Mr. Pink in 31 ms\nStarted  Brown\nDone with Mr. Joe in 20 ms, Mr. Brown in 3 ms, Mr. Eddie in 37 ms, Mr. Blue in 59 ms\nStarted  Blonde\nDone with Mr. White in 20 ms\nStarted  Orange\nDone with Mr. Blonde in 15 ms\nDone with Mr. Orange in 44 ms\n```\n\n### documentation\n\n`var batch = require('batch-these')`\n\n#### batch.these(chunk, callback)\n\n`chunk`\n  type: none | default: none\n\nData to be accumulated.\n\n`function` to pass the data when the time comes.\n\n#### batch.store([callback])\n\nHow to store your chunks. This is the default\n\n```js\nfunction batchStore(batch, chunk){\n  batch.data = batch.data || [ ];\n  batch.data.push(chunk);\n};\n```\n\n`batch.store()` returns the current `storer`.\n\n#### batch.filter([callback])\n\nDecides how the chunks are accumulated. The default is\n\n```js\nfunction batchFilter(batch, caller){\n  return batch.location === caller.location;\n};\n```\n\nWhere location has the stack format\n `filename:lineNumber:columNumber`\n\n`batch.filter()` returns the current filter.\n\n#### batch.wait([ms])\nms\n\ntype: `number` | default: `0` miliseconds\n\nTime in `ms` to wait in between batches.\n\n#### batch.origin([handle])\nhandle\n\ntype: `function` | default: `console.log`\n\nFunction to track down for the batches.\n\n### how it works\n\nInternally is using [callers-module](https://github.com/stringparser/callers-module) to get only 1 *stacktrace* frame. With that frame one can figure out *the exact location* of the `callback`. Based on that, a batch is stored. For each *location* a batch will kept waiting for a new chunk using a timer. Thats it.\n\nThe time to be waiting is set with `batch.wait([ms])` time.\n\nThe origin from which the *stacktrace* will be taken is set with `batch.origin([handle])`\n\nNOTE: the package is devised to work hand in hand with `process.stdout.write`. That is, the package [*monkeypatches*](https://github.com/stringparser/stdout-monkey) `stdout` in order to feed from its data.\n\nThough it would need some changes as it is, it should work with any other function call. With a prior patch, that is.\n\n## why\n\nYou would like to keep `stdout` writes to the bare minimum.\n\n## test\n\n    npm test\n\n### license\n\n[\u003cimg alt=\"LICENSE\" src=\"http://img.shields.io/npm/l/batch-these.svg?style=flat-square\"/\u003e](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringparser%2Fbatch-these","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstringparser%2Fbatch-these","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringparser%2Fbatch-these/lists"}