{"_id":"p-each-series","_rev":"8-346e0f7014cc1fcef80c2f8696662822","name":"p-each-series","description":"Iterate over promises serially","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"p-each-series","version":"1.0.0","description":"Iterate over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-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","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","bluebird"],"dependencies":{"p-reduce":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","time-span":"^1.0.0","xo":"*"},"xo":{"esnext":true},"gitHead":"321678961a70d01605d825be55214bf3b2143efa","bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","_id":"p-each-series@1.0.0","_shasum":"930f3d12dd1f50e7434457a22cd6f04ac6ad7f71","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"930f3d12dd1f50e7434457a22cd6f04ac6ad7f71","tarball":"https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz","integrity":"sha512-J/e9xiZZQNrt+958FFzJ+auItsBGq+UrQ7nE89AUP7UOTtjHnkISANXLdayhVzh538UnLMCSlf13lFfRIAKQOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFfVbOLlxp9WqVTcx46mNYGh6ZFYSqWe4EEmhjgjmt2ZAiEAyEDMOpqX4ygGd3J8Mw3V2y/Znta9n3xxDmmVfuPtbpM="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-each-series-1.0.0.tgz_1477025957075_0.09900743956677616"},"directories":{}},"2.0.0":{"name":"p-each-series","version":"2.0.0","description":"Iterate over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","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":"b9ec5f5c128ff0bcd3f0f59b215074ec17465ef9","bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","_id":"p-each-series@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-f8qYQeWdhR+o/80sRDEcJl/id24ri09iZwoVvnCoFwA4jKR6G8m/A8i1j87TVw8YiL3WP457fjKS/tmap7ALoQ==","shasum":"25e3eb3c957210e34502a152033a4b8b42ba11ed","tarball":"https://registry.npmjs.org/p-each-series/-/p-each-series-2.0.0.tgz","fileCount":5,"unpackedSize":4774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci1b7CRA9TVsSAnZWagAAGlQP/ihPrpXPfn06UwI0OdFr\nbj6n003zL8hOGjZ39tjuPA9aec2pTD9X8a+3mWkq28juvFvP5AF23dpQGguc\nwvcIMWA6+OwLYnjBcJpqtOaBozZmJk7Yec2Ahlq1xIhAfypQPfmjKpZ89jDC\nr86UXCJv+UZkC92JDXY4Mm3Qb2PqB0H7aYdvtuo8WQcgJ34M3fYL6yyVZnB3\nxYxndPt6V0Ffh9qaNUun3yTtk1YuH3d0QXibASO1x304w8O6X8wz2OCzMOJS\n/un2jt8UCvYuPrwH8kvgNphjCe68pOD7+wBgJX3aYl1oaiL/Z5z2ylIeXazB\ncTtUs9jNSui6RoSPFaS+teNRFS5HaABhV4nwU43DXpuk3dPAbACKTQjUh5iU\nmPXNgyjKgUqehl5/Phht21VXnDOrPa2HpQFg9aZjJPhZdSnZuGRjFtd3MsDJ\n8NKedxWHtzbB8c6q2YwBo3vOHFNnRAFn426FaxBPHH/oekorZVCdLem/paLi\nLvZwyvtoYfen4cOaaWNImXWcy6iSsb4kOxxqGxkfWcspMQlpLGw9TY7bS+oZ\ncmHbTi5+IWOlhV2yNOOf8KeTVgt1kZwr9ma8kvk8wQkkRJ2PRVIzeasRBQr8\nEZUxfNqfrMtHZJa/UULsBAlfAxjE3EyqEuwRpuWnxylUF68wcdesnoLoaFic\nO8IK\r\n=kkWh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrCTsHaB3mPEPDqUxoirsJSY+D2/GyoKD5H/i+Q4WaoQIhALNMW2IzydaJhns14phcTWXqVf+9z+MhjW37YG2zuhLx"}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-each-series_2.0.0_1552635642537_0.21380944652601075"},"_hasShrinkwrap":false},"2.1.0":{"name":"p-each-series","version":"2.1.0","description":"Iterate over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","time-span":"^3.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"ccffc6404419c4a6c08aff12e146a6fe9b7f9501","bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","_id":"p-each-series@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-ZuRs1miPT4HrjFa+9fRfOFXxGJfORgelKV9f9nNOWw2gl6gVsRaVDOQP0+MI0G0wGKns1Yacsu0GjOFbTK0JFQ==","shasum":"961c8dd3f195ea96c747e636b262b800a6b1af48","tarball":"https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz","fileCount":5,"unpackedSize":5532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpY3ECRA9TVsSAnZWagAApwoQAIcAP1yz9AWdeyzSE9D2\nzq8LiogrRF1OrFRqtkCtpvYmfFRcKKhJCfO11Nd9i+NjhchA2b6exyevHCwK\n788q46+Afg5J6E5FuaBvMlhsj0vj7SGcx8IjyvmdWX+0hIpBrq2v5wfXl0t8\nAIFUQVNhi5InK9qXQpfz0DsjtzhLe8knFe389yeZRwen/WOfjaA3ZAwuWON2\nfoSYkVGbuzVlYIp/WivNmbgGjeD0+m5eW/fjiybaffT1kmrjvqJde8s5oQz1\nSc3HQJVzbGYO30wLY0NeG3LaQGXjxYzLWMkcQi0GM0Qv+QH4FeuACZFSRLtJ\nNKMZohH9a+LpgHdG249xiepgJGs2+ys3tSI5JCq2cUMKoQcg4HcaVLKzi2BD\n1wEKIOShp/oE7bdqZSQfjtcHrhSG4/VaH/e3ID2TcIBITwUTh8t/vNox0SJ0\nDBjmJesuYEWybHHPs1PoGvZXhr7Mln/064I+vGdoaCovE9rKJ2EM3aPIU1ss\nx8T9GSgilr86EK+McRwkQThPBsZQtCNtR3V/ORrlSV/goNpWKf2H8yjxLaFF\nrNJEpR7cp09vVSmUV12s439bGQW+pesz9Yo762GIqk6LTg2gRLdSEWDoxWct\nazzJ+hni3L3FqPd1cttbAtoWokX0AD8a9sJEK2/JqC4T4YxyptJqFLBoZUuW\nGzJP\r\n=TSqc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrw8IYYvb+GySWUjqOKS0HcsCIkObKLuh+1CCvLFisvwIhAMjN78avZQa6rk39t4ugwRJK1fqQTIW8fVeXOqj7xFao"}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-each-series_2.1.0_1554353604096_0.0836061994519759"},"_hasShrinkwrap":false},"2.2.0":{"name":"p-each-series","version":"2.2.0","description":"Iterate over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-series.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","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","time-span":"^3.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"133ef8bd6121bd22f9867ef80438aab9fced6125","bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","_id":"p-each-series@2.2.0","_nodeVersion":"15.1.0","_npmVersion":"6.14.8","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==","shasum":"105ab0357ce72b202a8a8b94933672657b5e2a9a","tarball":"https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz","fileCount":5,"unpackedSize":6336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftaDnCRA9TVsSAnZWagAAc+UP/iQ4hKD0bo1080Ty2PWr\n0kogxxX/DoSjnVSNz4Wt0p4TsVFh3LBnRPb1bRQw/pylrvoSz0BuugYkqsSQ\nKClKSbBsm6BhPw1ovyLdnKO4NDHT2V4oz3B2tEUdPitY0mTLvvWoTm+me1RX\nHJncR0hFdnhX1IJ/87puMtNFLqj2aN8fQgjw4Q6VoRLWEjVLUG3dfrGHUp0B\n4f3bIlRtb3sxuX1LdscxZrhoB5wCnfQqNx/hPsZo/n5CZbzYtgqWeOKA3yA8\n96J2Cc9VfirES/77rEEgM5IrAHDAlQZIywMmcrpelHvs6hHKJushgM1eHrTp\nrU43rVNitao2aT44+9N+qXwdKH8xLu6XoeuaPEYdgjj7oZPUZW5dMC8DOkmE\negrJNO5KReq6PfDX/JCDJghmRlf4gmjvpgkN+mXBl4K5LXZBsCb4DbUgIZeu\n0jQS/voTA/U9Rh8659lbPu4P63sZypi3NINnb/Y5WiOVq1jtx03ReUMNDuW4\n05t8V47N9zp7rehwf80/MHTtN/SQiOTHEUQ1cqDzIFMeBnLIQR1VpKf7pBVR\nfyD0iZ6LDMTsNWfAb0gN4wVHUHKYLobzs9YuWIL/BJxX88/4jGzKMZZvKiEj\nWGF7iLYzddKKntPzUQLF3zgdo729y0aApHxjqGs+0NzjYYb1wp/Ll2bC4Vv2\nxa12\r\n=38JR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDK/es/gYTba0H6N9UdLXsuJ1m2AHNUZ02Nj3Dl1dpu9AiEA8oOLAZ8hrgL4HMAKbcRhwGjpFG6A+TlBCM5aBq017bo="}]},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-each-series_2.2.0_1605738727266_0.3086274688186348"},"_hasShrinkwrap":false},"3.0.0":{"name":"p-each-series","version":"3.0.0","description":"Iterate over promises serially","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-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","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","bluebird"],"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","time-span":"^4.0.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"b212721691ac48e8081376a8f4f2ca77588acd01","bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","_id":"p-each-series@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==","shasum":"d1aed5e96ef29864c897367a7d2a628fdc960806","tarball":"https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz","fileCount":5,"unpackedSize":5943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb+fQCRA9TVsSAnZWagAA0NkP/ikOqmilmiQTc6A1YPJy\ngtbuGx6kfdehUzLoupTRrkJSgQWV67HpOVfCRRDzpSXq6Xq4fR034N53pkEd\nVWW7HQUc28/qr4A90CQfxjHQVggdtnLvMP25nj8tOsyC7H7OdfOzRgW7/2a3\ngDzlocjlBKGykko7KnnGl8FyIAnSCIp9/HvMJtjLaTbdmcOUIb20UKlqob1A\nSTqH7S8MtUkzEDEkpLr+uCAH/DW6EZiSPEXFokQyJhn+4IuiT+zfT+h74y1N\nD9KdaTe+JQye2YBJAJaau6Qha0zDPVKWvatLIzu/pEsPNGraC702wm6UL4gd\nHjA1a5wLjCqADI8/IVh5N3kuhwJFDFZl1yidXIs0l7MTQDp47SjyLuMedrJa\n22uHma8qUQzuFut7GAccD9e+rDQ/Fwj02L96zzQH+VZnYlM5xfxv3DH9TTSH\nJ3PnbPlmxzC+KuoMZ39salc44OhgwlXeeh9osX1HYggysuOd6kgaihTmN0yL\nQsZ4eOaNZjluiXFdgiXFJzynby2s+rYrHmDSAQQZesHCF85sv3eQZwh6Z8to\n3Xjxh+ORWD0+AxTI2rZN9UL1ktPf8T8dSbQFq+71hWt0jpT5OV2QfFtIAnbw\nNfnoF99y7aeFYY5+ePBJGskMPMOHtVpTU1XJ+28gZjc0q+ZsuObticEdmUg5\nSbLc\r\n=RMC7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4ncicK2zwJp8q6Yq/0HH91oKG2MrRBp7aOMiptLQqLAiAMc2fls/oxv29K0/XHeYETVt9rFH8QK34GDHDXW2jV1Q=="}]},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-each-series_3.0.0_1617946575887_0.44802851470563554"},"_hasShrinkwrap":false}},"readme":"# p-each-series\n\n> Iterate over promises serially\n\nUseful as a side-effect iterator. Prefer [`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-each-series\n```\n\n## Usage\n\n```js\nimport pEachSeries from 'p-each-series';\n\nconst keywords = [\n\tgetTopKeyword(), //=> Promise\n\t'rainbow',\n\t'pony'\n];\n\nconst iterator = async element => saveToDiskPromise(element);\n\nconsole.log(await pEachSeries(keywords, iterator));\n//=> ['unicorn', 'rainbow', 'pony']\n```\n\n## API\n\n### pEachSeries(input, iterator)\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `iterator` are fulfilled, or rejects if any of the promises reject. The fulfillment value is the original `input`.\n\n#### input\n\nType: `Iterable<Promise | unknown>`\n\nIterated over serially in the `iterator` function.\n\n#### iterator(element, index)\n\nType: `Function`\n\nReturn value is ignored unless it's `Promise`, then it's awaited before continuing with the next iteration.\n\n### pEachSeries.stop\n\nStop iterating through items by returning `pEachSeries.stop` from the iterator function.\n\n```js\nimport pEachSeries from 'p-each-series';\n\n// Logs `a` and `b`.\nconst result = await pEachSeries(['a', 'b', 'c'], value => {\n\tconsole.log(value);\n\n\tif (value === 'b') {\n\t\treturn pEachSeries.stop;\n\t}\n});\n\nconsole.log(result);\n//=> ['a', 'b', 'c']\n```\n\n## Related\n\n- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially\n- [p-series](https://github.com/sindresorhus/p-series) - Run promise-returning & async functions in series\n- [p-pipe](https://github.com/sindresorhus/p-pipe) - Compose promise-returning & async functions into a reusable pipeline\n- [p-waterfall](https://github.com/sindresorhus/p-waterfall) - Run promise-returning & async functions in series, each passing its result to the next\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","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2022-06-23T05:44:24.519Z","created":"2016-10-21T04:59:17.323Z","1.0.0":"2016-10-21T04:59:17.323Z","2.0.0":"2019-03-15T07:40:42.680Z","2.1.0":"2019-04-04T04:53:24.236Z","2.2.0":"2020-11-18T22:32:07.420Z","3.0.0":"2021-04-09T05:36:15.993Z"},"homepage":"https://github.com/sindresorhus/p-each-series#readme","keywords":["promise","foreach","for-each","for","each","collection","iterable","iterator","fulfilled","async","await","promises","serial","serially","series","bluebird"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-each-series.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/p-each-series/issues"},"license":"MIT","readmeFilename":"readme.md"}