{"_id":"@actuallyworks/p-map","name":"@actuallyworks/p-map","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"@actuallyworks/p-map","version":"4.0.0","description":"Map over promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","map","resolved","wait","collection","iterable","iterator","race","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"dependencies":{"aggregate-error":"^3.0.0"},"devDependencies":{"ava":"^2.2.0","delay":"^4.1.0","in-range":"^2.0.0","random-int":"^2.0.0","time-span":"^3.1.0","tsd":"^0.7.4","xo":"^0.27.2"},"types":"./index.d.ts","gitHead":"a4b4dec459544d98880bc53a580e53691aff9fa9","bugs":{"url":"https://github.com/sindresorhus/p-map/issues"},"homepage":"https://github.com/sindresorhus/p-map#readme","_id":"@actuallyworks/p-map@4.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-YdANZrROb8RlcoBv1rtGmD4AQORrPut/Dhl3zTo31bEqAL2iJY17zCK5SDmqEDCJDUs5jgss/D/yLWRz+y3Hvg==","shasum":"8021c4ec8b132a3b3bc3508840850bd443af5fb4","tarball":"https://registry.npmjs.org/@actuallyworks/p-map/-/p-map-4.0.0.tgz","fileCount":5,"unpackedSize":8702,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICxvubnmjfRvSSq2eDZjojNVHegy3uRmSE1UgTa/Vp9nAiB/REwGzhuG4lUWLMxyRJ73Hc+Ksup91u6Td5Y2fIR7Rg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLzpQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6TQ/5ADgI6I05g4/Kp9Lfwfivjv8BXJFoX+C4VCz9Oy2Zq5jlfYx9\r\n5tXY3DxghGnZ5hd0ZzTjEepuhla3uwv1zG1ENNmQEgWu0fY+k5N6p1KJ3UZg\r\nXLZ9OaDN6mgCw7i/kw5fd2PILsjZ1y2zKzOpISieAdzwL52di6o9O9hA4ZGk\r\nSuz/Hdcm+vYvTM5ZV+gPc8CpW1E1O3oScCzFHNE+jy/BUmS7IRJ5FiUCwkx3\r\ntv9i20xucC0ovBrH0TqTshiBn4wrkLVh602C1CcrBZzfnCXOWZ0AS/krSIc1\r\nFdZVgDwbOsNmeMiv6Ze7DI9xV/cY9wlJgMIWUBge28owLyUSP+jVnuoxfo5z\r\ntQS1S8nQJCRt/Dwwm8cuoUL4lZKHWvJeTZPs6bELSTrRICth6Y2dzN5B2RSO\r\nKfEuXXo7TbDODczlk5tCw94eO22XxSOF7VRUyJmNP//oR9VwInNIP0MFv4L0\r\n46BVzeCqYkTBi36Sn74ZHJjb+IK7E9FZIo2t2gj9s1qQOPN4ktaM2Vdqo8JX\r\nwow72d1aKNJTuXTVQMWFhjHYnRfY/ejuNw6kLSR4c88WLFhlnnWVVNWE2AmY\r\neX7M7INF25t5L3leXtWa+eUG5zDFYRo0VN76aoQBdu/fy/47ZVSvlcPsUMWB\r\nFqV2/lNFOzE3k4BsPlsfRqnRRnLMRwXSIWQ=\r\n=Zq92\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"floydophone","email":"floydophone@gmail.com"},"directories":{},"maintainers":[{"name":"floydophone","email":"floydophone@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-map_4.0.0_1664039504338_0.7188860718572461"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-24T17:11:44.274Z","4.0.0":"2022-09-24T17:11:44.517Z","modified":"2022-09-24T17:11:44.672Z"},"maintainers":[{"name":"floydophone","email":"floydophone@gmail.com"}],"description":"Map over promises concurrently","homepage":"https://github.com/sindresorhus/p-map#readme","keywords":["promise","map","resolved","wait","collection","iterable","iterator","race","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/p-map/issues"},"license":"MIT","readme":"# p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map)\n\n> Map over promises concurrently\n\nUseful when you need to run promise-returning & async functions multiple times with different inputs concurrently.\n\n## Install\n\n```\n$ npm install p-map\n```\n\n## Usage\n\n```js\nconst pMap = require('p-map');\nconst got = require('got');\n\nconst sites = [\n\tgetWebsiteFromUsername('https://sindresorhus'), //=> Promise\n\t'https://ava.li',\n\t'https://github.com'\n];\n\n(async () => {\n\tconst mapper = async site => {\n\t\tconst {requestUrl} = await got.head(site);\n\t\treturn requestUrl;\n\t};\n\n \tconst result = await pMap(sites, mapper, {concurrency: 2});\n\n\tconsole.log(result);\n\t//=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/']\n})();\n```\n\n## API\n\n### pMap(input, mapper, options?)\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.\n\n#### input\n\nType: `Iterable<Promise | unknown>`\n\nIterated over concurrently in the `mapper` function.\n\n#### mapper(element, index)\n\nType: `Function`\n\nExpected to return a `Promise` or value.\n\n#### options\n\nType: `object`\n\n##### concurrency\n\nType: `number` (Integer)\\\nDefault: `Infinity`\\\nMinimum: `1`\n\nNumber of concurrently pending promises returned by `mapper`.\n\n##### stopOnError\n\nType: `boolean`\\\nDefault: `true`\n\nWhen set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises.\n\n## p-map for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of p-map and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## Related\n\n- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency\n- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently\n- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently\n- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object`\n- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially\n- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control\n- [More…](https://github.com/sindresorhus/promise-fun)\n","readmeFilename":"readme.md"}