{"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","tarball":"http://registry-npm.ywwl.com/p-every/download/p-every-1.0.2.tgz","integrity":"sha512-gjwty1cfDiN3DjjEq9JX8go3pgG1CrqjSKW1YV1sFEZbv0wXqPCtP7rJRUvM3reZPP5lY3O0OzjC0H844hfvow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrA/Nl29oF/BMpHzkpEsfb0u+cRPpSwKjDCxXJaao/qQIhAKL5m9U58Y0QOqFY3AfimiKZ6i9fKUdoi91QlOs1ORQD"}],"size":2301,"noattachment":false,"key":"/p-every/-/p-every-1.0.2.tgz"},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-every-1.0.2.tgz_1495673195698_0.8527945869136602"},"directories":{},"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","publish_time":1495673196738,"_cnpm_publish_time":1495673196738,"dist-tags":{"latest":"2.0.0"}}