{"_id":"p-filter","_rev":"12-3f5afa45bf81e6daee16a10dd57a6b72","name":"p-filter","description":"Filter promises concurrently","dist-tags":{"latest":"4.1.0"},"versions":{"1.0.0":{"name":"p-filter","version":"1.0.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"dependencies":{"p-map":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"92325d87416a43dac04fdc32b9e9a86fbd5171ac","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@1.0.0","_shasum":"629d317150209c8fd508ba137713ef4bb920e9db","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"629d317150209c8fd508ba137713ef4bb920e9db","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-1.0.0.tgz","integrity":"sha512-avI7eFKTknwvQHBTnnQ+d02Tf1V6/7VYTmi2gVtqTVWaDiIn4s7MheT4DSnWc1IX3ouDSRCwn2B8AIPgXY1adg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNBxkukFrGZCmpf/ni7acbcJ5epMXDLDPA5VJolMTolAiEAqSqzSFRCk/Y+zjR2ID2/hLteQPgiZ3KU4cQcHCYHVJE="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-filter-1.0.0.tgz_1477023370757_0.32707744953222573"},"directories":{}},"2.0.0":{"name":"p-filter","version":"2.0.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"dependencies":{"p-map":"^2.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"99ea1ad59cf434af1c05023b47817f4f550e95ed","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-y0j4GHE3Vsj0GsmPCsaR6gvCDb5kJSIs87fL+Buhka/d/zk+VOmHNGADkE/QEIMH5Na4/sm7LrwXfT2fq8ZXGA==","shasum":"08f3d1f214aa2ab15d3a306dd65c13d3a4a07900","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-2.0.0.tgz","fileCount":5,"unpackedSize":4816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciINWCRA9TVsSAnZWagAAp5IQAKNAmoK0sB7+/3XlS+nU\n7QhpgOxULtVWJAMGYW3GU8o/kwBMmeYWyKo02ARevGiBZBEXvHmTypCeFDG0\n/ehTJDd3OUSahtgueH4f39otgjPc9K3ZtcXPJgzhYLG98eGTamazELdyJ9Hi\n4y0K8X/trQO7MLMsX3jEcGUsEidBJV95ABWZPsyq6RcAEXmfOnS/6b8u3Xoq\ns6FcQspniWF3LQ93izseFB3qAd6W1c91X9kVF2P4ZQS3j+LQfyyA3gIJblR2\nDHTQHz0MvGtjv+w+vDWMFurGlyffCG9WSasId3DoU/z2Yu3kDZBc2emaJneu\nlRzggFEI5dCk5QtvO+Sfd+nDsBAqO1mwQ9YqAW3DNCjouSW49sj9d4tpox1e\nKy1mVx9GbbqgwsYl8Ji2Lca8qCg29TDEETneUBs/fUW1OwIkPmllZ0l9c4lU\nnNBLghstCKLKhqOhB3F6ic4gSMZHhf6Yv4hhfcmegU27s907q/vtGeyXPGBs\nZRDjoM4w5SDw/K54/WtaB81XTjliCH5U6KEH9zmv4syvYPBd6jh+ZWozS+sl\n4zWndEn/Z4DVJZlGfMOlpRfRzu8scIXug/vBrx6oCElEhKYgIvM/GXH8Q2w3\ncNInlj+Jc9Idh6jPH/j4Cl8oYWglvi6+b35PinUn44FK5TbDIOpw1Mijn6Ei\n872O\r\n=6ING\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7IEMKqnU5BwAczc94oPOBSYUdtHzHFl5nukljMILZ4wIgfs/xKQnYt6Y8vyf+vkncqP7aU5qA+TmHq0zhrWSPv9E="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-filter_2.0.0_1552450390067_0.7734956600652936"},"_hasShrinkwrap":false},"2.1.0":{"name":"p-filter","version":"2.1.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"dependencies":{"p-map":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"095943f96513f7eb5da9b9ae944344fe954af82d","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==","shasum":"1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz","fileCount":5,"unpackedSize":5814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpY3zCRA9TVsSAnZWagAA/1sQAKEdQuE5Npl/MTleGZ1b\nDn9Ob03f6lNyHKf6PNRyt5ejPiLehCWclLH7q9ZVLb7Wp7sLC4ruWQ6JF7W0\nnkDK45WLUs7WnTYTqoR3O4ysDIZ/tG1DxYlmHUOdMPgFNKx+dmgT3a0y3gmO\n63qr/8HDPcxnwJ7ntRYAyzQXEvBKH8+4VTds+NuwfN0mN1VLNbsyYi0ZNuM3\nk420zl9Yd2nlsr4SDt+9Nu6bQZRYlPIkrvDtbgM5Ai/6Ci3r3NPAkFWIBwib\nA/tWT+7tlMB7ZvLwKDrFKY89MXAcLLQmVG/HpQFGHsS7aJfDCFXUmtNCLipY\nu3jd16Z861vTL6F+QmB85HFuL/waIfpcUcwMb/sLZwWyiK6uSJB5SniSypMv\nwKUhQAN5j+Dh4mw4p57VQdngyjeoxmP06kxC9QnR0O8PKCu+VB/WpRD0APHE\ns+dKyBoWyBz2MpQwMUrB9LneqdFUQU0WQXf1B2Dit0Yq49PeQqUF1KFMO4G1\ndIArmlpcw3+CpVZNgoWDcXNwWT3xkWZxGR5a/rpqbxJAtXsunZNJm8f2BYii\nF1vz2TgebrU9USnxR84o7ey1JDUXiXA6pvWv0gOzDHwoKLJeqdZup7h5/nyG\ncPH+XXh8iLi+f5pcUXb+exg5wpR68uCGX7fE+36rXz2z96fkWGOEU2kiIZ1L\n1hTL\r\n=X45i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM3RwhlFS6KcoWdzaKDy+sg9cVW8ufvhR4paxpepoOggIgWDAD0shT4HNQlVYQOBhRBcuEP6T0WWn2DqfmyTVQWQQ="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-filter_2.1.0_1554353650849_0.39423971424215853"},"_hasShrinkwrap":false},"3.0.0":{"name":"p-filter","version":"3.0.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.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.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"dependencies":{"p-map":"^5.1.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"befd29e865210d858cbacda364b30c2cca1384e9","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@3.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"integrity":"sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==","shasum":"ce50e03b24b23930e11679ab8694bd09a2d7ed35","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz","fileCount":5,"unpackedSize":5092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFae4CRA9TVsSAnZWagAAGzAP/Ry1w1EINguewyCd1BVw\n0hJ/Z8VZps5ftgN2LnmEMQON9XpittnW5ZYRJTDTfR5l2+2gvQwGNASjtKF/\nAzom1+XeSLFM5mP/IQEwyqIhd2mV1Qle8jbUbIcvCb98wAFiFGor7dQtJYaI\nKovdZ6sM+IOiFE6M/nQFfaYBSrTVd/yAGXegTCFSy/oBB7Cgf4Dkew2kDMr+\n5Vr57vp4xFIto4Bsp/DqU76cka+X7yqg84E0focHxK4rIcnY28gruraUtq1X\noDWxZKsD8MIKVQBCYviz/SCWsFxxEHJMRreCJAvZW/Aa//Kz6PuxZ85/oZrb\nZDDJjmNNNjhB3ypK7FW4Uk+KrXMRV6/9w5NO3YN7+GJBANuZNTBUQIcH/Kir\nNoOAIAEBp0kOGmz11CjYmKNRTZ/xwlQbIQ09LuElRjznoiC+Xf+SJSjKp/+G\nVVT8rSS2VqaKvJeFTHpKsGkXnNYvx9VhTij5AZ66bUdXIP28fZkAX7dwkBvt\nXHJVHo0bcNiDsB2mBTfY94nol2qMPq8Dfme12WXgsv+3suWyvqg9R3rjK/cL\ndPM9QiWhThfG84dLDj0S8GSjsYEhu08xFvDzpoyZgIxFpdIEE98FKL6bs3BW\nPH567oEKMs5mFjZykD/xiPHNjbi5otC7+/w38lrOHhBj/hzlTd3fsLML13Nu\nVJsI\r\n=pzxj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpGBaTHNP1heYqtLom6iTfOQw4Jugp4E63Iq7pFgPcfAiACZixP7yVd2Iz7uF1AJRqYZRK0XNtNjLU710FFGfnlNA=="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-filter_3.0.0_1628809144118_0.30858885067994235"},"_hasShrinkwrap":false},"4.0.0":{"name":"p-filter","version":"4.0.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel"],"dependencies":{"p-map":"^7.0.0"},"devDependencies":{"ava":"^6.0.1","tsd":"^0.30.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"def98651f6e086e10d05cf2be49795fb4caba418","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@4.0.0","_nodeVersion":"21.2.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-3gxOrNadcyxj+YKFyRmRIEuCMGayNNJoXL7Zf1dqfdfoDsVB190bHfFfhqfcNEDFLfQP1q2uir2cBgIqnIT+cQ==","shasum":"10d55bf804712a1301a9bfb1588d5ec641cce754","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-4.0.0.tgz","fileCount":5,"unpackedSize":8117,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6a0IeDcD8aebGNNtqdxpQ1EYwUxtEZxzInhGa/A6EKwIhAPVz+zFDA90sBahBR2qthvPh0wEPKviDgjUlWobyszM9"}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-filter_4.0.0_1703260910374_0.4073599827487109"},"_hasShrinkwrap":false},"4.1.0":{"name":"p-filter","version":"4.1.0","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel"],"dependencies":{"p-map":"^7.0.1"},"devDependencies":{"ava":"^6.0.1","tsd":"^0.30.1","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"ec5496d1ce853addb6a003652565c9223ea51fba","bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"homepage":"https://github.com/sindresorhus/p-filter#readme","_id":"p-filter@4.1.0","_nodeVersion":"21.2.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-37/tPdZ3oJwHaS3gNJdenCDB3Tz26i9sjhnguBtvN0vYlRIiDNnvTWkuh+0hETV9rLPdJ3rlL3yVOYPIAnM8rw==","shasum":"fe0aa794e2dfad8ecf595a39a245484fcd09c6e4","tarball":"https://registry.npmjs.org/p-filter/-/p-filter-4.1.0.tgz","fileCount":5,"unpackedSize":8173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArNAt1+2GTqxBodqqAQ5TkGX/a3RyQNiMCwt/708YjuAiB6lKCxn5JLEqOrW3qSTlhrvVRHsEX6PBVlkgG7fmnQUQ=="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-filter_4.1.0_1703692976091_0.9156248707343033"},"_hasShrinkwrap":false}},"readme":"# p-filter\n\n> Filter promises concurrently\n\nUseful when you need to run promise-returning & async functions multiple times with different inputs concurrently and get a filtered down result.\n\n## Install\n\n```sh\nnpm install p-filter\n```\n\n## Usage\n\n```js\nimport pFilter from 'p-filter';\nimport getWeather from 'get-weather'; // Not a real module\n\nconst places = [\n\tgetCapital('Norway').then(info => info.name),\n\t'Bangkok, Thailand',\n\t'Berlin, Germany',\n\t'Tokyo, Japan',\n];\n\nconst filterer = async place => {\n\tconst weather = await getWeather(place);\n\treturn weather.temperature > 30;\n};\n\nconst result = await pFilter(places, filterer);\n\nconsole.log(result);\n//=> ['Bangkok, Thailand']\n```\n\n## API\n\n### pFilter(input, filterer, options?)\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `filterer` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `filterer` in `input` order.\n\n#### input\n\nType: `Iterable<Promise<unknown> | unknown>`\n\nIterated over concurrently in the `filterer` function.\n\n#### filterer(element, index)\n\nType: `Function`\n\nThe filterer function that decides whether an element should be included into result. Expected to return `boolean | Promise<boolean>`.\n\n#### options\n\nType: `object`\n\nSee the [`p-map` options](https://github.com/sindresorhus/p-map#options).\n\n##### concurrency\n\nType: `number`\\\nDefault: `Infinity`\\\nMinimum: `1`\n\nThe number of concurrently pending promises returned by `filterer`.\n\n### pFilterIterable(iterable, filterer, options?)\n\nReturns an async iterable that iterates over the promises in `iterable` and ones returned from `filterer` concurrently, calling `filterer` for each element.\n\n```js\nimport {pFilterIterable} from 'p-filter';\nimport getWeather from 'get-weather'; // Not a real module\n\nasync function * getPlaces() {\n\tconst name = await getCapital('Norway');\n\n\tyield name;\n\tyield 'Bangkok, Thailand';\n\tyield 'Berlin, Germany';\n\tyield 'Tokyo, Japan';\n}\n\nconst places = getPlaces();\n\nconst filterer = async place => {\n\tconst weather = await getWeather(place);\n\treturn weather.temperature > 30;\n};\n\nfor await (const element of pFilterIterable(places, filterer)) {\n\tconsole.log(element);\n}\n//=> ['Bangkok, Thailand']\n```\n\n#### iterable\n\nType: `Iterable<Promise<unknown> | unknown>`\n\nIterated over concurrently in the `filterer` function.\n\n#### filterer(element, index)\n\nType: `Function`\n\nThe filterer function that decides whether an element should be included into result. Expected to return `boolean | Promise<boolean>`.\n\n#### options\n\nType: `object`\n\nSee the [`p-map` options](https://github.com/sindresorhus/p-map#options).\n\n##### concurrency\n\nType: `number`\\\nDefault: `Infinity`\\\nMinimum: `1`\n\nThe number of concurrently pending promises returned by `filterer`.\n\n## Related\n\n- [p-locate](https://github.com/sindresorhus/p-locate) - Get the first fulfilled promise that satisfies the provided testing function\n- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently\n- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently\n- [More…](https://github.com/sindresorhus/promise-fun)\n","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2023-12-27T16:02:56.439Z","created":"2016-10-21T04:16:12.722Z","1.0.0":"2016-10-21T04:16:12.722Z","2.0.0":"2019-03-13T04:13:10.234Z","2.1.0":"2019-04-04T04:54:11.010Z","3.0.0":"2021-08-12T22:59:04.308Z","4.0.0":"2023-12-22T16:01:50.571Z","4.1.0":"2023-12-27T16:02:56.291Z"},"homepage":"https://github.com/sindresorhus/p-filter#readme","keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-filter.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/p-filter/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"seangenabe":true,"rocket0191":true,"flumpus-dev":true}}