// the find
tannerlinsley/swimmer
🏊 Swimmer - An async task pooling and throttling utility for JS
Swimmer is a tiny concurrency-pooling library for running a batch of promise-returning functions with a throttle limit, from Tanner Linsley (before he went all-in on TanStack). It offers a simple `poolAll` for one-off batches and a `createPool` API for a reusable, controllable queue. Good fit for someone who wants basic concurrency limiting without pulling in a bigger dependency.
Genuinely tiny (3kb) with zero dependencies, and the whole implementation lives in a single src/index.js file, so it's easy to read end to end in a few minutes. The createPool API supports live throttle adjustment, pause/stop/start, and priority-queuing a task ahead of pending ones, which is more control than most 'run N at a time' libraries bother with. The thunk requirement (pass functions, not fired-off promises) is called out explicitly, heading off the most common misuse of this pattern.
Last commit was in August 2020 — six years with no releases, no TypeScript types, and no async iterator or AbortSignal support that's become standard in this space. No package.json types field or a .d.ts, so TS users get no autocomplete and have to write their own declarations. In poolAll, a single task failure kills the whole pool and throws, which is fine for 'all must succeed' cases but means there's no built-in way to collect partial results — you have to drop to createPool and handle onError yourself. For anything new, p-limit or p-queue are actively maintained, have TS types out of the box, and cover the same ground.