{"_id":"p-map-series","_rev":"149935","name":"p-map-series","description":"Map over promises serially","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T11:31:49.000Z","created":"2016-10-21T04:35:52.144Z","3.0.0":"2021-04-09T06:29:40.139Z","2.1.0":"2019-04-03T05:19:37.928Z","2.0.0":"2019-03-15T08:02:57.597Z","1.0.0":"2016-10-21T04:35:52.144Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map-series.git"},"versions":{"3.0.0":{"name":"p-map-series","version":"3.0.0","description":"Map over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map-series.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","map","collection","iterable","iterator","fulfilled","serial","serially","async","await","promises","bluebird"],"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","time-span":"^4.0.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"bc1b9f5e19ed62363bff3d7dc5ecc1fd820ccb51","bugs":{"url":"https://github.com/sindresorhus/p-map-series/issues"},"homepage":"https://github.com/sindresorhus/p-map-series#readme","_id":"p-map-series@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"6a07efcdf8b44c8f1ce38ec0a98807dc4ada34a6","size":2474,"noattachment":false,"key":"/p-map-series/-/p-map-series-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-map-series/download/p-map-series-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-map-series_3.0.0_1617949779969_0.05545155406002156"},"_hasShrinkwrap":false,"publish_time":1617949780139,"_cnpm_publish_time":1617949780139},"2.1.0":{"name":"p-map-series","version":"2.1.0","description":"Map over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","map","collection","iterable","iterator","fulfilled","serial","serially","async","await","promises","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","time-span":"^3.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"86caaee6bb1bc07c280974468b92d5012d8f4a12","bugs":{"url":"https://github.com/sindresorhus/p-map-series/issues"},"homepage":"https://github.com/sindresorhus/p-map-series#readme","_id":"p-map-series@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7560d4c452d9da0c07e692fdbfe6e2c81a2a91f2","size":2477,"noattachment":false,"key":"/p-map-series/-/p-map-series-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-map-series/download/p-map-series-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-map-series_2.1.0_1554268777469_0.18405653710035752"},"_hasShrinkwrap":false,"publish_time":1554268777928,"_cnpm_publish_time":1554268777928},"2.0.0":{"name":"p-map-series","version":"2.0.0","description":"Map over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","map","collection","iterable","iterator","fulfilled","serial","serially","async","await","promises","bluebird"],"devDependencies":{"ava":"^1.3.1","delay":"^4.1.0","time-span":"^3.0.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"23e6cf899da2bbfa25846cbbb9cb9e77e4ba331a","bugs":{"url":"https://github.com/sindresorhus/p-map-series/issues"},"homepage":"https://github.com/sindresorhus/p-map-series#readme","_id":"p-map-series@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c9bb0d98c0093cbfa27187781bf593069bc9ed08","size":2268,"noattachment":false,"key":"/p-map-series/-/p-map-series-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-map-series/download/p-map-series-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-map-series_2.0.0_1552636977459_0.015901539918462326"},"_hasShrinkwrap":false,"publish_time":1552636977597,"_cnpm_publish_time":1552636977597},"1.0.0":{"name":"p-map-series","version":"1.0.0","description":"Map over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-map-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","map","collection","iterable","iterator","fulfilled","serial","serially","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","time-span":"^1.0.0","xo":"*"},"xo":{"esnext":true},"gitHead":"fbaef9ebce16944e28510a05f6928b1f162ea30d","bugs":{"url":"https://github.com/sindresorhus/p-map-series/issues"},"homepage":"https://github.com/sindresorhus/p-map-series#readme","_id":"p-map-series@1.0.0","_shasum":"bf98fe575705658a9e1351befb85ae4c1f07bdca","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bf98fe575705658a9e1351befb85ae4c1f07bdca","size":2106,"noattachment":false,"key":"/p-map-series/-/p-map-series-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-map-series/download/p-map-series-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-map-series-1.0.0.tgz_1477024551917_0.27259076246991754"},"directories":{},"publish_time":1477024552144,"_cnpm_publish_time":1477024552144,"_hasShrinkwrap":false}},"readme":"# p-map-series\n\n> Map over promises serially\n\nUseful as a side-effect mapper. Use [`p-map`](https://github.com/sindresorhus/p-map) if you don't need side-effects, as it's concurrent.\n\n## Install\n\n```\n$ npm install p-map-series\n```\n\n## Usage\n\n```js\nimport pMapSeries from 'p-map-series';\n\nconst keywords = [\n\tgetTopKeyword() //=> Promise\n\t'rainbow',\n\t'pony'\n];\n\nlet scores = [];\n\nconst mapper = async keyword => {\n\tconst score = await fetchScore(keyword);\n\tscores.push(score);\n\treturn {keyword, score};\n});\n\nconsole.log(await pMapSeries(keywords, mapper));\n/*\n[\n\t{\n\t\tkeyword: 'unicorn',\n\t\tscore: 99\n\t},\n\t{\n\t\tkeyword: 'rainbow',\n\t\tscore: 70\n\t},\n\t{\n\t\tkeyword: 'pony',\n\t\tscore: 79\n\t}\n]\n*/\n```\n\n## API\n\n### pMapSeries(input, mapper)\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 `mapper` created promises fulfillment values.\n\n#### input\n\nType: `Iterable<Promise | unknown>`\n\nMapped over serially in the `mapper` function.\n\n#### mapper(element, index)\n\nType: `Function`\n\nExpected to return a value. If it's a `Promise`, it's awaited before continuing with the next iteration.\n\n## Related\n\n- [p-each-series](https://github.com/sindresorhus/p-each-series) - Iterate over promises serially\n- [p-reduce](https://github.com/sindresorhus/p-reduce) - Reduce a list of values using promises into a promise for a value\n- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently\n- [More…](https://github.com/sindresorhus/promise-fun)\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-p-map-series?utm_source=npm-p-map-series&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","_attachments":{},"homepage":"https://github.com/sindresorhus/p-map-series#readme","bugs":{"url":"https://github.com/sindresorhus/p-map-series/issues"},"license":"MIT"}