Request
Issue #24
draft pr openWe installed dependencies and ran test in a sandbox — all passed.
An AI estimate of whether the change actually fixes the issue — the checks themselves only confirm nothing broke. It's a hint for review, not a pass/fail check.
Why?
The diff exports `pMapConcurrency` from `index.js`, computing it from `os.cpus().length` with a cap of 8 and a CI fallback of 2, exactly matching the request for a reusable, reasonable default concurrency value. It is fully wired up in `index.d.ts`, documented in `readme.md`, and covered by tests in `test.js` so consumers can pass it to the `concurrency` option.
testpassed · 14.4s
> p-map@7.0.4 test > xo && ava && tsd ✔ test › pMapConcurrency is a positive integer ✔ test › handles empty iterable ✔ test › asyncIterator - handles empty iterable ✔ test › pMapIterable - empty ✔ test › invalid mapper ✔ test › already aborted signal ✔ test › pMapIterable - iterable that throws ✔ test › pMapSkip ✔ test › pMapIterable - mapper that throws ✔ test › all pMapSkips ✔ test › multiple pMapSkips ✔ test › pMapIterable - pMapSkip ✔ test › pMapConcurrency is 2 in CI ✔ test › pMapConcurrency is based on CPU count when not in CI ✔ test › enforce number in options.concurrency ✔ test › asyncIterator - enforce number in options.concurrency ✔ test › asyncIterator - pMapSkip ✔ test › asyncIterator - all pMapSkips ✔ test › abort by AbortController (101ms) ✔ test › asyncIterator - multiple pMapSkips (111ms) ✔ test › no unhandled rejected promises from mapper throws - infinite concurrency (118ms) ✔ test › no unhandled rejected promises from mapper throws - concurrency 1 (119ms) ✔ test › pMapIterable - stop on error (118ms) ✔ test › async with concurrency: 2 (out of order time sequence) (225ms) ✔ test › async with concurrency: 2 (problematic time sequence) (231ms) ✔ multiple-pmapskips-performance › multiple pMapSkips - algorithmic complexity (220ms) ✔ test › asyncIterator - async with concurrency: 2 (out of order time sequence) (231ms) ✔ test › async with concurrency: 2 (random time sequence) (259ms) ✔ test › asyncIterator - async with concurrency: 2 (problematic time sequence) (281ms) ✔ test › asyncIterator - async with concurrency: 2 (random time sequence) (283ms) ✔ test › main (331ms) ✔ test › pMapIterable (314ms) ✔ test › pMapIterable - async input, backpressure > concurrency (316ms) ✔ test › catches exception from source iterator - 1st item (325ms) ✔ test › asyncIterator - main (331ms) ✔ test › pMapIterable - concurrency: 2 (363ms) ✔ test › catches exception from source iterator - 2nd item (417ms) ✔ test › catches exception from source iterator - 2nd item after 1st item mapper throw (418ms) ✔ test › asyncIterator - all mappers should run when concurrency is infinite, even after stop-on-error happened (500ms) ✔ test › asyncIterator - get the correct exception after stop-on-error (500ms) ✔ test › incorrect input type (501ms) ✔ test › immediately rejects when stopOnError is true (547ms) ✔ test › asyncIterator - immediately rejects when stopOnError is true (591ms) ✔ test › all mappers should run when concurrency is infinite, even after stop-on-error happened (621ms) ✔ test › concurrency: 1 (626ms) ✔ test › pMapIterable - concurrency: 1 (614ms) ✔ test › pMapIterable - index in mapper (616ms) ✔ test › asyncIterator - concurrency: 1 (652ms) ✔ test › pMapIterable - backpressure (1s) ✔ test › aggregate errors when stopOnError is false (1.2s) ✔ test › asyncIterator - aggregate errors when stopOnError is false (1.3s) ✔ test › concurrency: 4 (3s) ✔ test › asyncIterator - concurrency: 4 (3.1s) ─ 53 tests passed npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. npm warn Unknown user config "dangerously-allow-all-builds". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. npm warn Unknown user config "verify-deps-before-run". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
lint, typecheck, and build are not defined separately in this repo.
Ran 6/7/2026, 8:59:27 PM · npm
Get the code
Pull this branch
gh pr checkout 14 --repo kamransiddiqui/p-map
git fetch https://github.com/kamransiddiqui/p-map.git gitgot/issue-24 git checkout -b gitgot/issue-24 FETCH_HEAD
Fork-mode request: the branch lives on kamransiddiqui/p-map (your fork), not sindresorhus/p-map, so the commands above target the fork.
Drive locally
Paste this into your local coding agent (Claude Code, Cursor, etc.) to continue iterating with full repo context.
You are continuing work on a draft PR for sindresorhus/p-map, addressing issue #24. First, check out the branch with gitgot's first-pass change (run from a clone of the repo): gh pr checkout 14 --repo kamransiddiqui/p-map Then review the diff and: - run the project's lint/typecheck/test commands and fix anything broken - if the diff is wrong-headed, revert it and start fresh from the issue - keep the change tight; do not refactor unrelated code
- No comments on the PR yet. Use the form below to start the thread.