New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tiny-pasync

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-pasync

All tiny-* async utilities in one package. Drop-in replacements for p-limit, p-map, p-retry, p-queue. ESM + CJS, zero transitive dependencies.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

tiny-async

npm version npm downloads CI TypeScript License: MIT

All tiny-* async utilities in one package. Drop-in replacements for p-limit, p-map, p-retry, and p-queue that ship ESM + CJS.

import { pLimit, pMap, pRetry, PQueue } from "tiny-pasync";

One install. Four utilities. All dual-format, all typed, all zero-dep individually.

Install

npm install tiny-pasync

What's included

ExportReplacesDocs
pLimitp-limittiny-limit
pMap, pMapSkipp-maptiny-map
pRetry, AbortErrorp-retrytiny-retry
PQueuep-queuetiny-queue

Each utility is also available as a standalone package if you only need one.

Quick examples

Limit concurrency

import { pLimit } from "tiny-pasync";

const limit = pLimit(5);
const results = await Promise.all(urls.map((url) => limit(() => fetch(url))));

Map with concurrency

import { pMap } from "tiny-pasync";

const pages = await pMap(urls, (url) => fetch(url).then((r) => r.text()), {
  concurrency: 10,
});

Retry with backoff

import { pRetry } from "tiny-pasync";

const data = await pRetry(() => fetchFromUnreliableAPI(), { retries: 3 });

Task queue with priority

import { PQueue } from "tiny-pasync";

const queue = new PQueue({ concurrency: 2 });
await queue.add(() => processJob(1));
await queue.add(() => urgentJob(), { priority: 10 });
await queue.onIdle();

Why not just install the originals?

p-limit v4+, p-map v6+, p-retry v6+, and p-queue v8+ are all ESM-only. CommonJS projects that require() them get ERR_REQUIRE_ESM.

The tiny-* packages ship both ESM and CJS, include TypeScript types, and have zero dependencies. This meta-package re-exports everything from one import.

The tiny-* family

PackageReplacesWhat it does
tiny-limitp-limitConcurrency limiter
tiny-mapp-mapConcurrent map with order
tiny-retryp-retryRetry with exponential backoff
tiny-queuep-queuePriority task queue
tiny-msmsParse/format durations
tiny-escapeescape-string-regexpEscape regex chars
tiny-pasyncall of the aboveOne import for all async utils

Author

Made by ofershap

LinkedIn GitHub

If this saved you from ERR_REQUIRE_ESM, star the repo or open an issue if something breaks.

License

MIT © Ofer Shapira

Keywords

p-limit

FAQs

Package last updated on 05 Mar 2026

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