{"_id":"p-some","_rev":"411904","name":"p-some","description":"Wait for a specified number of promises to be fulfilled","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-08-04T05:11:17.000Z","created":"2016-10-21T05:27:16.467Z","6.0.0":"2021-05-31T14:17:04.325Z","5.0.0":"2020-02-19T12:40:11.636Z","4.1.0":"2019-04-05T07:04:23.395Z","4.0.0":"2019-03-08T12:02:09.762Z","3.0.0":"2018-05-26T08:30:16.546Z","2.0.1":"2017-12-27T09:40:50.415Z","2.0.0":"2017-06-12T22:37:42.678Z","1.2.1":"2017-06-12T22:34:02.116Z","1.2.0":"2017-06-09T21:54:36.879Z","1.1.0":"2017-01-13T13:17:29.294Z","1.0.0":"2016-10-21T05:27:16.467Z"},"users":{"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"versions":{"6.0.0":{"name":"p-some","version":"6.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.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"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^4.0.0","p-cancelable":"^3.0.0"},"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","tsd":"^0.16.0","xo":"^0.40.1"},"gitHead":"a7030ea6ad9971867ba5dfdb09034a416f3cf8e3","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@6.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"4613a822038abe125e42152ea9f7705a7967526f","size":2991,"noattachment":false,"key":"/p-some/-/p-some-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some_6.0.0_1622470624221_0.6974854217963782"},"_hasShrinkwrap":false,"publish_time":1622470624325,"_cnpm_publish_time":1622470624325},"5.0.0":{"name":"p-some","version":"5.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^3.0.0","p-cancelable":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","tsd":"^0.11.0","xo":"^0.26.1"},"gitHead":"66981d4f0531f347a9ae6d2a87b657444846cad3","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@5.0.0","_nodeVersion":"10.18.1","_npmVersion":"6.13.7","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"8b730c74b4fe5169d7264a240ad010b6ebc686a4","size":3121,"noattachment":false,"key":"/p-some/-/p-some-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-5.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some_5.0.0_1582116011517_0.27586732933001157"},"_hasShrinkwrap":false,"publish_time":1582116011636,"_cnpm_publish_time":1582116011636},"4.1.0":{"name":"p-some","version":"4.1.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^3.0.0","p-cancelable":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"57614d17800711af957d5efe06becbb5a0e1373b","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@4.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"28e73bc1e0d62db54c2ed513acd03acba30d5c04","size":3175,"noattachment":false,"key":"/p-some/-/p-some-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some_4.1.0_1554447863283_0.976850290435185"},"_hasShrinkwrap":false,"publish_time":1554447863395,"_cnpm_publish_time":1554447863395},"4.0.0":{"name":"p-some","version":"4.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^2.2.0","p-cancelable":"^1.1.0"},"devDependencies":{"ava":"^1.3.1","delay":"^4.1.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"e93321929d8a651fcd062ca969a1c28ff3d1d0ad","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@4.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"1968f41c530e9572ae591ef657d544b1772b12a6","size":3018,"noattachment":false,"key":"/p-some/-/p-some-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some_4.0.0_1552046529568_0.0687132906540211"},"_hasShrinkwrap":false,"publish_time":1552046529762,"_cnpm_publish_time":1552046529762},"3.0.0":{"name":"p-some","version":"3.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0","p-cancelable":"^0.4.1"},"devDependencies":{"ava":"*","delay":"^3.0.0","xo":"*"},"gitHead":"4c21d2456154e86fc8e26474c787fe2d63b72c8e","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e099513d89070301a4c0fc22810fa6abf6b218dd","size":2644,"noattachment":false,"key":"/p-some/-/p-some-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some_3.0.0_1527323416467_0.5373062719536816"},"_hasShrinkwrap":false,"publish_time":1527323416546,"_cnpm_publish_time":1527323416546},"2.0.1":{"name":"p-some","version":"2.0.1","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"9046af94efbaac0f3abf1e2c89c8871cc627d219","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@2.0.1","_shasum":"65d87c8b154edbcf5221d167778b6d2e150f6f06","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"65d87c8b154edbcf5221d167778b6d2e150f6f06","size":2429,"noattachment":false,"key":"/p-some/-/p-some-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-2.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some-2.0.1.tgz_1514367650271_0.4987953444942832"},"directories":{},"publish_time":1514367650415,"_hasShrinkwrap":false,"_cnpm_publish_time":1514367650415},"2.0.0":{"name":"p-some","version":"2.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"2af345a5836ab7b161a7c8a447ed9bd2d09850e8","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@2.0.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"60b408e21f5da11a417fad13740bf20f9024ab3b","size":2412,"noattachment":false,"key":"/p-some/-/p-some-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some-2.0.0.tgz_1497307061690_0.3894792189821601"},"directories":{},"publish_time":1497307062678,"_hasShrinkwrap":false,"_cnpm_publish_time":1497307062678},"1.2.1":{"name":"p-some","version":"1.2.1","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","xo":"*"},"xo":{"esnext":true},"gitHead":"df155fbee874c0f23eb37195ce8b1747c80e7090","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@1.2.1","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"554019ede881a93958f8292f351eb0d03c6cb67f","size":2481,"noattachment":false,"key":"/p-some/-/p-some-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-1.2.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some-1.2.1.tgz_1497306841159_0.46364825940690935"},"directories":{},"publish_time":1497306842116,"_cnpm_publish_time":1497306842116,"_hasShrinkwrap":false},"1.2.0":{"name":"p-some","version":"1.2.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","xo":"*"},"xo":{"esnext":true},"gitHead":"8d052329875e91b75228294409cd538236600bb6","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@1.2.0","_shasum":"83799e4692e32895100c69551681bab804a963da","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"83799e4692e32895100c69551681bab804a963da","size":2450,"noattachment":false,"key":"/p-some/-/p-some-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-some-1.2.0.tgz_1497045275947_0.19814508920535445"},"directories":{},"publish_time":1497045276879,"_hasShrinkwrap":false,"_cnpm_publish_time":1497045276879},"1.1.0":{"name":"p-some","version":"1.1.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","xo":"*"},"xo":{"esnext":true},"gitHead":"3cf8199906f1117cc14bddad3fd117f33de044f8","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@1.1.0","_shasum":"7e6388f3f06cfbb4ecbfb93f0d324b785efb9ec6","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7e6388f3f06cfbb4ecbfb93f0d324b785efb9ec6","size":2238,"noattachment":false,"key":"/p-some/-/p-some-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-some-1.1.0.tgz_1484313449070_0.9721606217790395"},"directories":{},"publish_time":1484313449294,"_cnpm_publish_time":1484313449294,"_hasShrinkwrap":false},"1.0.0":{"name":"p-some","version":"1.0.0","description":"Wait for a specified number of promises to be fulfilled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-some.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","some","resolved","wait","collection","iterable","iterator","race","fulfilled","race","fastest","async","await","promises","bluebird"],"dependencies":{"aggregate-error":"^0.1.0"},"devDependencies":{"ava":"*","delay":"^1.3.1","xo":"*"},"xo":{"esnext":true},"gitHead":"7043cd7b8f4dde97347d86e1d5cd23f3cee22e2b","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"homepage":"https://github.com/sindresorhus/p-some#readme","_id":"p-some@1.0.0","_shasum":"e41fdf2ccd79cf38bb1c99b00c70d59fefe43a73","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e41fdf2ccd79cf38bb1c99b00c70d59fefe43a73","size":2256,"noattachment":false,"key":"/p-some/-/p-some-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-some/download/p-some-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-some-1.0.0.tgz_1477027634283_0.8781284117139876"},"directories":{},"publish_time":1477027636467,"_cnpm_publish_time":1477027636467,"_hasShrinkwrap":false}},"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","_attachments":{},"homepage":"https://github.com/sindresorhus/p-some#readme","bugs":{"url":"https://github.com/sindresorhus/p-some/issues"},"license":"MIT"}