{"_id":"p-try-each","_rev":"2-a40d5336b9505a5d91f1a5c55e07fc3b","name":"p-try-each","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"p-try-each","version":"1.0.0","description":"Runs promise-returning functions in series but stops whenever any of the functions were successful","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","test":"jest --config jestconfig.json","prepare":"npm run build","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/PedroMiguelSS/p-try-each.git"},"keywords":["sequential","promises","promise","series","async","await","array","tasks"],"author":"","license":"MIT","bugs":{"url":"https://github.com/PedroMiguelSS/p-try-each/issues"},"homepage":"https://github.com/PedroMiguelSS/p-try-each#readme","devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","prettier":"^1.18.2","ts-jest":"^24.1.0","tslint":"^5.20.0","tslint-config-prettier":"^1.18.0","typescript":"^3.6.4"},"gitHead":"ab5b0cc465d3c25a745cda54c1b1eb7e6d524446","_id":"p-try-each@1.0.0","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-8xItxBk8cVe/n3o1XLk+61VJxvXERgxqiJNFEoZ3SOI6/RBh1BNVXK49bBO45hjZRoTccNwMq86HdSihLUlcOA==","shasum":"068a4440cff2e7fb6539575b72b643cc091c02b1","tarball":"https://registry.npmjs.org/p-try-each/-/p-try-each-1.0.0.tgz","fileCount":5,"unpackedSize":4854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdo7BfCRA9TVsSAnZWagAAuBsP/3b748SBmpgi4ACW2b4k\ntG7xXQr00ydD8Nsducm9ZVLTf+GeezMRD/JHKtECkx2uUf7hocJDfsQbSOkB\nifvd5lH9hWyhZCqkr/L9RtYKyj+j76vFHsBLdb81EPv08eAzm88qsN0G4ZVu\nhCvqmI9MD2yvbK6EoeQGV4M6cC8ssb7/VWP1P83TRTu0LdDp6GpY28eAwOrF\nK3TNCmiC02mBfX4TDragtiWLhLxL2/MuLs+8I3qsYQpd62+Q2q7VGXz6v+nW\n4jJbTwV+0S/mZRo1+qBhbOfjyp8IP+1qRUrOzNRRf03RlQ6oPb05EOSSasZX\nrB5yd9FJZ9hN1kPmveKDGm3OKTCMa6FK/x3tcrqv8jMFWA9HJsJKxKSLyU+p\nUAJS7DQvNM5DnekpeBx/6UNT//rtUd6kd6IpRcRqwbDDEAiOst0kX3oytI05\njhpmMqk7qELUXKAVGfmcBe6WI+k3bNzN0zeqK5+zFui/1xfXtWcSv2WuAmiG\nDoswl0X38XYLOOjyIIHyvSYdXSUY3HxlaVXZEBA1GjCRl49lX17CbQvjcWFr\nLcmClmBG/dG0f0uAZ+UQ2gvM4V5EUnw5xC0RLEqtGgJ39duxY/Vcojv5UxiS\nWJ7dBhA8q1w7BucvT579d7GAkLlNmfSEBVO5c40zHjD4zTuUBAXJS8TYWAR3\nbFLx\r\n=UXts\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6gWVQQDslUAMRHLXZZO8gZnk4McL7merW+8u7o4+G4wIgPFSLJWwOp3O/fcsKA7jEY0INxoVZkgpqqNaxJGTMmSM="}]},"maintainers":[{"name":"pedromiguelss","email":"pedromiguelsousasantos@hotmail.com"}],"_npmUser":{"name":"pedromiguelss","email":"pedromiguelsousasantos@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-try-each_1.0.0_1571008606482_0.05672400065654459"},"_hasShrinkwrap":false},"1.0.1":{"name":"p-try-each","version":"1.0.1","description":"Runs promise-returning functions in series but stops whenever any of the functions were successful","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","test":"jest --config jestconfig.json","prepare":"npm run build","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/PedroMiguelSS/p-try-each.git"},"keywords":["sequential","promises","promise","series","async","await","array","tasks"],"author":"","license":"MIT","bugs":{"url":"https://github.com/PedroMiguelSS/p-try-each/issues"},"homepage":"https://github.com/PedroMiguelSS/p-try-each#readme","devDependencies":{"@types/jest":"^24.0.18","jest":"^24.9.0","prettier":"^1.18.2","ts-jest":"^24.1.0","tslint":"^5.20.0","tslint-config-prettier":"^1.18.0","typescript":"^3.6.4"},"gitHead":"9dc1bb6fc3f137bb8e3d4f7040388e8fe4fecb2b","_id":"p-try-each@1.0.1","_nodeVersion":"12.10.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-WyUjRAvK4CG9DUW21ZsNYcBj6guN7pgZAOFR8mUtyNXyPC5WUo3L48nxI5TsGEZ+VJhZXzyeH/Sxi2lxYcPp3A==","shasum":"24b4b830a134cb71a934d03b76e702bed439c3c1","tarball":"https://registry.npmjs.org/p-try-each/-/p-try-each-1.0.1.tgz","fileCount":5,"unpackedSize":4846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpD7JCRA9TVsSAnZWagAAHbAQAIH3YDROebODG8Th/AK8\nPl17G5dWjHOP0g3WsiEa9qerZy7J0UEnmfR1q504BXX9l94Tj/sJWLU132kj\nbnIApDKoE/YM8XHVTb+kSbYhrFSKmym4HqoVyor9R4NEEFsiq5Nfwn1VvSXo\npI+xhswQyF6MaAdSoqTFEtbj57PGbIsfI+HuzmB4ycibeo9iLy2KpwS0LVDi\nZphrGFDsoquulyNwPX62ORxUoOhsh2MsaUDZdG1MAJoYXeKQemfAb/vH6iAR\nmI/hL9IVp89ZwUIH2HkP3bLrDRknRy2mZwpDBchsX0IAWMRP2c2Lp3RUyXcJ\nTvK4cAs5jAFQQioA3Ahuq6SH6+jHtoPrBmeOvkXWTcr0RP5T/kF3KXui8IcU\np4DDGAuJIyNCP7NcnyxPT14DEXI2SM2x5LBH3Qx0I5niZIA/cURUjJTh1GBp\nV9y5VwZ6ubn+X8dOBdsZCUFM9evOGWJlRSRLQI5i6ZNSUIoaw/hEyg2FUWo3\nJPOa84eJBtRwIMIsUl9KvniqcXEm1XnUMM7Jz9awSpGGtodZG6g1r3tbIthI\nFQ4ss28z+0A84ck/3ngpSZJihMclF5LTaNprn2eNVhhcLNp2N+mxdlV2Or0I\n0/jP98simhIcxt7p3g3ehf1Brvc7C+NLAunXHcWT2ae2gyoTMYuGu2K3EVrF\nY7Gc\r\n=A5ek\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6wtvfQ6K5EEcs3wVpDJCG4++ZktowKX3xHiBeqQY4bwIhAIdWPhhl+Xuc1MzxjTVXkFFv2/cOlPjQYcvK8vM2Pru9"}]},"maintainers":[{"name":"pedromiguelss","email":"pedromiguelsousasantos@hotmail.com"}],"_npmUser":{"name":"pedromiguelss","email":"pedromiguelsousasantos@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-try-each_1.0.1_1571045064312_0.9597276808129374"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-13T23:16:46.482Z","1.0.0":"2019-10-13T23:16:46.578Z","modified":"2022-05-12T10:34:49.553Z","1.0.1":"2019-10-14T09:24:24.473Z"},"maintainers":[{"name":"pedromiguelss","email":"pedromiguelsousasantos@hotmail.com"}],"description":"Runs promise-returning functions in series but stops whenever any of the functions were successful","homepage":"https://github.com/PedroMiguelSS/p-try-each#readme","keywords":["sequential","promises","promise","series","async","await","array","tasks"],"repository":{"type":"git","url":"git+https://github.com/PedroMiguelSS/p-try-each.git"},"bugs":{"url":"https://github.com/PedroMiguelSS/p-try-each/issues"},"license":"MIT","readme":"# p-try-each [![Build Status](https://travis-ci.org/PedroMiguelSS/p-try-each.svg?branch=master)](https://travis-ci.org/PedroMiguelSS/p-try-each)\n\n> Runs promise-returning functions in series but stops whenever any of the functions were successful. If all functions reject, the promise will be rejected with the error of the final task\n\nSimilar to [`async/tryEach`](https://caolan.github.io/async/v3/docs.html#tryEach).\n\n## Install\n\n```\nnpm install --save p-try-each\n```\n\n## Usage\n\n```js\nconst pTryEach = require('p-try-each');\n\nconst tasks = [\n  () => Promise.resolve('foo'),\n  () => Promise.resolve('bar'),\n  () => Promise.resolve('baz')\n]\n\n(async () => {\n  const res = await pTryEach(tasks);\n  console.log(res);\n  // Logs:\n  // 'foo'\n})();\n```\n\n## API\n\n### pTryEach(tasks)\n\nReturns a `Promise` that is fulfilled with the value of the first fulfilled promise returned from calling the functions in `tasks`. If none is fulfilled, the promise will be rejected with the error of the final task.\n\n#### tasks\n\nType: `Iterable<Function>`\n\nFunctions must return a value. In case of a returned promise, it will be awaited before starting with the next task.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}