npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lllbatch

v1.0.5

Published

- [github](https://github.com/LLL-Studio/LLLBatch) - [npm](https://www.npmjs.com/package/lllbatch)

Downloads

659

Readme

LLLBatch

Smart Async Concurrency Control & Batch Processor with Zero Dependencies. 의존성 제로, 설정 파일 기반의 초경량 비동기 동시성 제어 및 배치 처리기

⚡ Features

  • 📦 ESM Native Only: Designed exclusively for modern ECMAScript Modules (import/export).

  • ⚙️ Config-Driven: Automatically detects and loads lllbatch.config.js from your root folder.

  • 🔥 Rolling Window Queue: High-throughput execution. Next task starts immediately when one finishes, instead of waiting for the entire chunk.

  • 🛡️ Bulletproof: If one task fails, it safely catches the error and continues the rest of the queue.

🚀 Installation / 설치

npm install lllbatch

⚠️ Prerequisite / 필수 조건: This Package is ESM-only. Ensure "type": "module" is set in your package.json. 본 패키지는 ESM 전용입니다. package.json"type": "module"이 설정되어 있어야 합니다.

🛠️ Configuration / 설정 방법

Create a lllbatch.config.js file in your project root to set global options.

프로젝트 루트 폴더에 lllbatch.config.js 파일을 생성하여 전역 설정을 관리할 수 있습니다.

// lllbatch.config.js
export default {
  concurrency: 5 // Max parallel workers (Default: 3) / 동시에 처리할 최대 작업 수
};

💻 Usage / 사용법

🇺🇸 English Guide

You can batch process arrays with a rolling concurrency pool. Inline options always override the global configuration file.

import { batch } from 'lllbatch';

// Simulate an async task that takes 1 second
const mockTask = (id) => new Promise(resolve => setTimeout(() => resolve(`Result ${id}`), 1000));

const items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

// 1. Using global configuration (e.g., 5 from lllbatch.config.js)
const results = await batch(items, async (id) => {
  return await mockTask(id);
});

// 2. Overriding inline (Dynamically change concurrency to 10)
const fastResults = await batch(items, async (id) => {
  return await mockTask(id);
}, { concurrency: 10 });

🇰🇷 한국어 가이드

배열 데이터와 비동기 함수를 던지면 설정된 개수만큼 끊어서 효율적으로 실행합니다. 코드 내부에 직접 명시한 인라인 옵션은 설정 파일보다 우선순위가 높습니다.

import { batch } from 'lllbatch';

// 1초가 걸리는 가짜 비동기 태스크
const mockTask = (id) => new Promise(resolve => setTimeout(() => resolve(`결과 ${id}`), 1000));

const items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

// 1. 전역 설정 파일 적용 (lllbatch.config.js에 적힌 개수대로 실행)
const results = await batch(items, async (id) => {
  return await mockTask(id);
});

// 2. 인라인 옵션으로 뭉개기 (순간적으로 동시성을 10으로 올려서 초고속 처리)
const fastResults = await batch(items, async (id) => {
  return await mockTask(id);
}, { concurrency: 10 });

📊 API Reference

batch(items, fn, options?)

Parameters

  • items(Array): An array of data to process. / 처리할 데이터 배열.
  • fn(Function): Async callback function executed for each item. Receives (item, index). / 각 아이템을 처리할 비동기 콜백 함수.
  • options (Object, optional):
  • concurrency (number): Overrides the default or configured max parallel worker limit. / 전역 설정을 무시하고 동시 실행 수를 직접 지정.

Return Value

  • Returns a Promise resolving to an array of results. If a task throws an error, the specific index in the array will contain the Error object instead of crashing the whole batch.
  • 실행 결과 배열을 담은 Promise를 반환합니다. 특정 작업에서 에러가 발생하더라도 전체 프로세스가 터지지 않고, 해당 인덱스에 Error 객체가 안전하게 담깁니다.

📄 License

MIT © lll-ecosystem