{"_id":"p-waterfall","_rev":"284946","name":"p-waterfall","description":"Run promise-returning & async functions in series, each passing its result to the next","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T18:32:26.000Z","created":"2016-11-22T07:41:27.598Z","3.0.0":"2021-04-09T06:43:04.981Z","2.1.1":"2020-12-18T11:21:19.108Z","2.1.0":"2019-04-03T05:23:39.356Z","2.0.0":"2019-03-18T16:45:35.055Z","1.0.0":"2016-11-22T07:41:27.598Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.git"},"versions":{"3.0.0":{"name":"p-waterfall","version":"3.0.0","description":"Run promise-returning & async functions in series, each passing its result to the next","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.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","waterfall","series","serial","sequence","sequential","ordered","task","tasks","array","collection","iterable","iterator","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^3.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"39b6a5bff89996406d790a6ab9bf39d3fe36620a","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"homepage":"https://github.com/sindresorhus/p-waterfall#readme","_id":"p-waterfall@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5ac12ae8bed4f118b1d37bb1a3c91c4674f68558","size":2499,"noattachment":false,"key":"/p-waterfall/-/p-waterfall-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-waterfall/download/p-waterfall-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-waterfall_3.0.0_1617950584802_0.20502340354403858"},"_hasShrinkwrap":false,"publish_time":1617950584981,"_cnpm_publish_time":1617950584981},"2.1.1":{"name":"p-waterfall","version":"2.1.1","description":"Run promise-returning & async functions in series, each passing its result to the next","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","waterfall","series","serial","sequence","sequential","ordered","task","tasks","array","collection","iterable","iterator","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"3fd82480f4ebee2d434c9d50d923e35106d89b54","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"homepage":"https://github.com/sindresorhus/p-waterfall#readme","_id":"p-waterfall@2.1.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"63153a774f472ccdc4eb281cdb2967fcf158b2ee","size":2626,"noattachment":false,"key":"/p-waterfall/-/p-waterfall-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-waterfall/download/p-waterfall-2.1.1.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-waterfall_2.1.1_1608290478906_0.19685188544092513"},"_hasShrinkwrap":false,"publish_time":1608290479108,"_cnpm_publish_time":1608290479108},"2.1.0":{"name":"p-waterfall","version":"2.1.0","description":"Run promise-returning & async functions in series, each passing its result to the next","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","waterfall","series","serial","sequence","sequential","ordered","task","tasks","array","collection","iterable","iterator","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"d9726a2c1b5b146350289c50b1cc92b4d91730c8","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"homepage":"https://github.com/sindresorhus/p-waterfall#readme","_id":"p-waterfall@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4d4bdd1729c7e790593797e79d0ab71d16ff9ec2","size":2462,"noattachment":false,"key":"/p-waterfall/-/p-waterfall-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-waterfall/download/p-waterfall-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-waterfall_2.1.0_1554269019239_0.4172843649691138"},"_hasShrinkwrap":false,"publish_time":1554269019356,"_cnpm_publish_time":1554269019356},"2.0.0":{"name":"p-waterfall","version":"2.0.0","description":"Run promise-returning & async functions in series, each passing its result to the next","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","waterfall","series","serial","sequence","sequential","ordered","task","tasks","array","collection","iterable","iterator","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^2.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.5.0","xo":"^0.24.0"},"gitHead":"097b16d202b6bd24bc334d260723435a48101284","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"homepage":"https://github.com/sindresorhus/p-waterfall#readme","_id":"p-waterfall@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0ab849c3db232b642f29df4aa8449823544a3feb","size":2352,"noattachment":false,"key":"/p-waterfall/-/p-waterfall-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-waterfall/download/p-waterfall-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-waterfall_2.0.0_1552927534892_0.6401447346682732"},"_hasShrinkwrap":false,"publish_time":1552927535055,"_cnpm_publish_time":1552927535055},"1.0.0":{"name":"p-waterfall","version":"1.0.0","description":"Run promise-returning & async functions in series, each passing its result to the next","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-waterfall.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","waterfall","series","serial","sequence","sequential","ordered","task","tasks","array","collection","iterable","iterator","async","await","promises","bluebird"],"dependencies":{"p-reduce":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"6905c126059359d1c6ad973dde2e168843f5413f","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"homepage":"https://github.com/sindresorhus/p-waterfall#readme","_id":"p-waterfall@1.0.0","_shasum":"7ed94b3ceb3332782353af6aae11aa9fc235bb00","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7ed94b3ceb3332782353af6aae11aa9fc235bb00","size":1908,"noattachment":false,"key":"/p-waterfall/-/p-waterfall-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-waterfall/download/p-waterfall-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-waterfall-1.0.0.tgz_1479800485689_0.9512806851416826"},"directories":{},"publish_time":1479800487598,"_cnpm_publish_time":1479800487598,"_hasShrinkwrap":false}},"readme":"# p-waterfall\n\n> Run promise-returning & async functions in series, each passing its result to the next\n\n## Install\n\n```\n$ npm install p-waterfall\n```\n\n## Usage\n\n```js\nimport pWaterfall from 'p-waterfall';\n\nconst tasks = [\n\tinitialValue => getEmoji(initialValue),\n\tpreviousValue => `I ❤️ ${previousValue}`\n];\n\nconsole.log(await pWaterfall(tasks, 'unicorn'));\n//=> 'I ❤️ ????'\n```\n\n## API\n\n### pWaterfall(tasks, initialValue?)\n\nReturns a `Promise` that is fulfilled when all promises returned from calling the functions in `tasks` are fulfilled, or rejects if any of the promises reject. The fulfilled value is the value returned from the last task.\n\n#### tasks\n\nType: `Iterable<Function>`\n\nFunctions are expected to return a value. If a `Promise` is returned, it's awaited before continuing with the next task.\n\n#### initialValue\n\nType: `unknown`\n\nValue to use as `previousValue` in the first task.\n\n## Related\n\n- [p-series](https://github.com/sindresorhus/p-series) - Run promise-returning & async functions in series\n- [p-each-series](https://github.com/sindresorhus/p-each-series) - Iterate over promises serially\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-waterfall?utm_source=npm-p-waterfall&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-waterfall#readme","bugs":{"url":"https://github.com/sindresorhus/p-waterfall/issues"},"license":"MIT"}