{"_id":"p-every","_rev":"943152","name":"p-every","description":"Test whether all promises passes a testing function","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"kevva","email":""}],"time":{"modified":"2021-09-23T02:09:29.000Z","created":"2017-05-24T01:19:54.762Z","2.0.0":"2019-03-15T09:22:34.849Z","1.0.2":"2017-05-25T00:46:36.738Z","1.0.1":"2017-05-24T01:25:35.831Z","1.0.0":"2017-05-24T01:19:54.762Z"},"users":{},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"repository":{"type":"git","url":"git+https://github.com/kevva/p-every.git"},"versions":{"2.0.0":{"name":"p-every","version":"2.0.0","description":"Test whether all promises passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-every.git"},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["async","await","bluebird","collection","concurrency","concurrently","every","filter","fulfilled","iterable","iterator","parallel","promise","promises"],"dependencies":{"p-map":"^2.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"025ab918257adf4702f530ac585ddc3373d68edd","bugs":{"url":"https://github.com/kevva/p-every/issues"},"homepage":"https://github.com/kevva/p-every#readme","_id":"p-every@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"ad940b82b1bd1da01c307b11e1dd25fe7286181a","size":2480,"noattachment":false,"key":"/p-every/-/p-every-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-every/download/p-every-2.0.0.tgz"},"maintainers":[{"name":"kevva","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-every_2.0.0_1552641754654_0.3169331683907497"},"_hasShrinkwrap":false,"publish_time":1552641754849,"_cnpm_publish_time":1552641754849},"1.0.2":{"name":"p-every","version":"1.0.2","description":"Test whether all promises passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-every.git"},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["async","await","bluebird","collection","concurrency","concurrently","every","filter","fulfilled","iterable","iterator","parallel","promise","promises"],"dependencies":{"p-map":"^1.1.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"4492cea34071931000ca114e4e77ca119f83671c","bugs":{"url":"https://github.com/kevva/p-every/issues"},"homepage":"https://github.com/kevva/p-every#readme","_id":"p-every@1.0.2","_shasum":"4e01d85c23da19ed71a4afba319bdb4d94c85e00","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.8.0","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"4e01d85c23da19ed71a4afba319bdb4d94c85e00","size":2301,"noattachment":false,"key":"/p-every/-/p-every-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-every/download/p-every-1.0.2.tgz"},"maintainers":[{"name":"kevva","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-every-1.0.2.tgz_1495673195698_0.8527945869136602"},"directories":{},"publish_time":1495673196738,"_cnpm_publish_time":1495673196738,"_hasShrinkwrap":false},"1.0.1":{"name":"p-every","version":"1.0.1","description":"Test whether all promises passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-every.git"},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["async","await","bluebird","collection","concurrency","concurrently","every","filter","fulfilled","iterable","iterator","parallel","promise","promises"],"dependencies":{"p-filter":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"e1ecea89595f8a4e96efce8b8033ae8557ec5d2e","bugs":{"url":"https://github.com/kevva/p-every/issues"},"homepage":"https://github.com/kevva/p-every#readme","_id":"p-every@1.0.1","_shasum":"2682d6d45026a8ab6c39229b9b300ffc2b1cf42e","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.8.0","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"2682d6d45026a8ab6c39229b9b300ffc2b1cf42e","size":2143,"noattachment":false,"key":"/p-every/-/p-every-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-every/download/p-every-1.0.1.tgz"},"maintainers":[{"name":"kevva","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-every-1.0.1.tgz_1495589134874_0.580252633895725"},"directories":{},"publish_time":1495589135831,"_hasShrinkwrap":false,"_cnpm_publish_time":1495589135831},"1.0.0":{"name":"p-every","version":"1.0.0","description":"Test whether all promises passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-every.git"},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["async","await","bluebird","collection","concurrency","concurrently","every","filter","fulfilled","iterable","iterator","parallel","promise","promises"],"dependencies":{"p-filter":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"16b3619513bf18a7e329b9d31d07d3fcb39df209","bugs":{"url":"https://github.com/kevva/p-every/issues"},"homepage":"https://github.com/kevva/p-every#readme","_id":"p-every@1.0.0","_shasum":"2eeb6e8701d25b01801dcb4144e30dd1add873d7","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.8.0","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"2eeb6e8701d25b01801dcb4144e30dd1add873d7","size":2134,"noattachment":false,"key":"/p-every/-/p-every-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/p-every/download/p-every-1.0.0.tgz"},"maintainers":[{"name":"kevva","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-every-1.0.0.tgz_1495588793844_0.95263373083435"},"directories":{},"publish_time":1495588794762,"_hasShrinkwrap":false,"_cnpm_publish_time":1495588794762}},"readme":"# p-every [![Build Status](https://travis-ci.org/kevva/p-every.svg?branch=master)](https://travis-ci.org/kevva/p-every)\n\n> Test whether all promises passes a testing function\n\nLike [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) for promises.\n\n## Install\n\n```\n$ npm install --save p-every\n```\n\n\n## Usage\n\n```js\nconst pEvery = require('p-every');\nconst getContinent = require('get-continent'); // 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 testFunction = async place => {\n\tconst continent = await getContinent(place);\n\treturn continent === 'europe';\n}\n\n(async () => {\n\tconst result = await pEvery(places, testFunction);\n\tconsole.log(result);\n\t//=> false\n})();\n```\n\n\n## API\n\n### pEvery(input, testFunction, [options])\n\nReturns a `Promise` that is fulfilled when all promises in `input` and ones returned from `testFunction` are fulfilled, or rejects if any of the promises reject. The fulfilled value is a `boolean` that is `true` if all Promises passed the test and `false` otherwise.\n\n#### input\n\nType: `Iterable<Promise|any>`\n\nIterated over concurrently in the `testFunction` function.\n\n#### testFunction(element, index)\n\nType: `Function`\n\nPredicate function, expected to return a `Promise<boolean>` or `boolean`.\n\n#### options\n\nType: `Object`\n\n##### concurrency\n\nType: `number`<br>\nDefault: `Infinity`<br>\nMinimum: `1`\n\nNumber of concurrently pending promises returned by `testFunction`.\n\n\n## Related\n\n* [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently\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* [More…](https://github.com/sindresorhus/promise-fun)\n\n\n## License\n\nMIT © [Kevin Martensson](http://github.com/kevva)\n","_attachments":{},"homepage":"https://github.com/kevva/p-every#readme","bugs":{"url":"https://github.com/kevva/p-every/issues"},"license":"MIT"}