Skip to content

0x80/process-in-chunks

Repository files navigation

Process in Chunks

Efficiently process large collections of data in manageable chunks with built-in error handling, throttling, and TypeScript support.

Features

  • Chunked parallel processing for optimal throughput
  • Fail-fast or graceful error collection with discriminated unions
  • Built-in throttling to control processing rate
  • Full TypeScript support with type inference
  • Zero dependencies

Quick Start

pnpm add process-in-chunks
import { processInChunks } from "process-in-chunks";

const results = await processInChunks(
  [1, 2, 3, 4, 5],
  async (item) => item * 2,
);
console.log(results); // [2, 4, 6, 8, 10]

Documentation

For full documentation visit process-in-chunks.codecompose.dev.

License

MIT

About

Process and array of items in chunks with optional throttling

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors