{"_id":"@cjser/p-some__v6_0_0","name":"@cjser/p-some__v6_0_0","dist-tags":{"latest":"6.0.0-cjser.2"},"versions":{"6.0.0-cjser.2":{"name":"@cjser/p-some__v6_0_0","version":"6.0.0-cjser.2","description":"Wait for a specified number of promises to be fulfilled","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"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"@cjser/aggregate-error__v4_0_1":"4.0.1-cjser.2","@cjser/p-cancelable__v3_0_0":"3.0.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","tsd":"^0.16.0","xo":"^0.40.1"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"6.0.0","cjserVersion":2,"original":{"name":"p-some","version":"6.0.0","exports":"./index.js","repository":"sindresorhus/p-some","dependencies":{"aggregate-error":"^4.0.0","p-cancelable":"^3.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/p-some__v6_0_0@6.0.0-cjser.2","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-GzIKevdCUtkr4SEUsPGq+pytWk/MYKvLB21UhkN1rP/4LcKMAzP3Y7lir9E7Fa/zyLXpPA+QbRZXDeAvgnMI3g==","shasum":"08ff28eac725b07aaa36098a47b766e6cf031824","tarball":"https://registry.npmjs.org/@cjser/p-some__v6_0_0/-/p-some__v6_0_0-6.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":12644,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCF/XF1yn44Z+/uZYobCzEV4AkIJe1JqwgJMco4rBJbvgIgZvuBpvFv6HmjYH8PwsvDio07Hf4tbN9MQgsODX7TPXA="}]},"_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-some__v6_0_0_6.0.0-cjser.2_1778130887680_0.051437620515776716"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:14:47.584Z","6.0.0-cjser.2":"2026-05-07T05:14:47.897Z","modified":"2026-05-07T05:14:48.094Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Wait for a specified number of promises to be fulfilled","keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","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-some\n\n> Wait for a specified number of promises to be fulfilled\n\nUseful when you need the fastest of multiple promises.\n\n## Install\n\n```\n$ npm install p-some\n```\n\n## Usage\n\nChecks 4 websites and logs the 2 fastest.\n\n```js\nimport got from 'got';\nimport pSome from 'p-some';\n\nconst input = [\n\tgot.head('github.com').then(() => 'github'),\n\tgot.head('google.com').then(() => 'google'),\n\tgot.head('twitter.com').then(() => 'twitter'),\n\tgot.head('medium.com').then(() => 'medium')\n];\n\nconst [first, second] = await pSome(input, {count: 2});\n\nconsole.log(first, second);\n//=> 'google twitter'\n```\n\n## API\n\n### pSome(input, options)\n\nReturns a [cancelable `Promise`](https://github.com/sindresorhus/p-cancelable) that is fulfilled when `count` promises from `input` are fulfilled. The fulfilled value is an `Array` of the values from the `input` promises in the order they were fulfilled. If it becomes impossible to satisfy `count`, for example, too many promises rejected, it will reject with an [`AggregateError`](https://github.com/sindresorhus/aggregate-error) error.\n\nIf you pass in cancelable promises, specifically promises with a `.cancel()` method, that method will be called for the promises that are still unfulfilled when the returned `Promise` is either fulfilled or rejected.\n\n#### input\n\nType: `Iterable<Promise | unknown>`\n\nAn `Iterable` collection of promises/values to wait for.\n\n#### options\n\nType: `object`\n\n##### count\n\n*Required*\\\nType: `number`\\\nMinimum: `1`\n\nNumber of promises from `input` that have to be fulfilled until the returned promise is fulfilled.\n\n##### filter\n\nType: `Function`\n\nReceives the value resolved by the promise. Used to filter out values that doesn't satisfy a condition.\n\n### AggregateError\n\nExposed for instance checking.\n\n### FilterError\n\nExposed for instance checking.\n\n## Related\n\n- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled\n- [p-one](https://github.com/kevva/p-one) - Return `true` if any promise passes a testing function, similar to `Array#some`\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-some\n","readmeFilename":"readme.md","_rev":"1-181e4c582b64b20d54ed51b72ab4c25c"}