Micro library for batch running promises


micro library for batch running promises (Node/Browser/Deno)

Note: This is not a promise map alternative, promise map runs promises in parallel while keeping the given concurrency intact after every successful resolve, this runs it in sequential batches

For low powered/memory systems and browsers it's sometimes impossible to run all the promises at once and it's easier to run it in batches one after the other, this helper basically does that. It chains the batches in a dependency chain and waits for the first batch to finish before executing the next.This can be controlled by the limit option, by providing the number of promises that a single batch will have.



npm i @barelyreaper/conch
# or
yarn add @barelyreaper/conch


import conch from '';
// or 
import conch from "


const conch = require('@barelyreaper/conch');

const data = [
    item: 1,
    item: 2,
    item: 3,

function getData(item) {
  return new Promise((resolve) => {
    setTimeout(() => {
    }, 2500);

// Will take 3 * 2500 , considering there's 3 items and only one can run at once (limit:1)
conch(data, getData, { limit: 1 }).then((data) => {
  console.log({ data });


yarn # install devDeps
yarn test # check the if the limit is being taken in consideration
yarn build # build the package


You are free to fork,fix or create your own version

Logo vector created by lyolya_profitrolya -