Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

maximize-iterator

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maximize-iterator

Maximize the parallel calls of an iterator supporting asyncIterator interface

Source
npmnpm
Version
5.0.2
Version published
Weekly downloads
2.2K
-16.84%
Maintainers
1
Weekly downloads
 
Created
Source

maximize-iterator

Maximize the parallel calls of an iterator supporting asyncIterator interface.

const maximize = require('maximize-iterator');

(async ()=> {
  // run 1024 in parallel until done - promises
  var iterator = // create it somehow with a next method returing {done: value: }
  await maximize(iterator, (value) => { /* do something including false stop */ }, { concurrency: 1024, limit: Infinity, error: (err) => { return true; /* filter errors */ } });
})();

// run 1024 in parallel until done - callbacks
var iterator = // create it somehow with a next method returing {done: value: }
maximize(iterator, (value) => { /* do something including false stop */ }, { concurrency: 1024, limit: Infinity,  error: (err) => { return true; /* filter errors */ } }, (err) => {
  /* done */
});

forEach Options:

  • bool: callbacks - use an each function with a callback function(entry, callback) (default: false)
  • number: concurrency - parallelism of processing. (default: Infinity)
  • number: limit - maximum number to process. (default: Infinity)
  • number: batch - per batch count to limit expansion. (default: 10)

Keywords

maximize

FAQs

Package last updated on 18 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts