{"_id":"@cjser/p-filter__v3_0_0","name":"@cjser/p-filter__v3_0_0","dist-tags":{"latest":"3.0.0-cjser.2"},"versions":{"3.0.0-cjser.2":{"name":"@cjser/p-filter__v3_0_0","version":"3.0.0-cjser.2","description":"Filter promises concurrently","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./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":{"@cjser/p-map__v5_5_0":"5.5.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.0","cjserVersion":2,"original":{"name":"p-filter","version":"3.0.0","exports":"./index.js","repository":"sindresorhus/p-filter","dependencies":{"p-map":"^5.1.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/p-filter__v3_0_0@3.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ECua1hVLMwxqCMW1OKksXZXBE6a+F/U4xQt/CoWwaj2kjpxWZa8fV5qN7n9s5Q5sYL/RTfQFYFe+L4wcBw//Gw==","shasum":"d708fbd7456df7708a6bf0c14cbf46114a2c65b4","tarball":"https://registry.npmjs.org/@cjser/p-filter__v3_0_0/-/p-filter__v3_0_0-3.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":8096,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAfl+ssa/rI+4cKJJZDlSfL3o/YsIOs0RfNcuenBWXpNAiEAoYdnDR7VNBWxB+ouI5heurwMTO4gHJtfuj1gNdhtF8E="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/p-filter__v3_0_0_3.0.0-cjser.2_1778159337720_0.18907282117446433"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:08:57.608Z","3.0.0-cjser.2":"2026-05-07T13:08:57.904Z","modified":"2026-05-07T13:08:58.113Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Filter promises concurrently","keywords":["promise","filter","collection","iterable","iterator","fulfilled","async","await","promises","concurrently","concurrency","parallel","bluebird"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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```\n$ npm 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|any>`\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\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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/p-filter\n","readmeFilename":"readme.md","_rev":"1-3a749a5eda9b8c9a82256051fc8d1330"}