{"_id":"p-one","_rev":"4-d857a3a111f839d8fad3a74deb241a4c","name":"p-one","description":"Test whether some promise passes a testing function","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"p-one","version":"1.0.0","description":"Test whether some promise passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-one.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","filter","fulfilled","iterable","iterator","parallel","promise","promises","some","test"],"dependencies":{"p-map":"^1.1.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"ef56b4e28c83b3f060b8860b0306e36cd7303a44","bugs":{"url":"https://github.com/kevva/p-one/issues"},"homepage":"https://github.com/kevva/p-one#readme","_id":"p-one@1.0.0","_shasum":"af6fe60044ebd0cec5ab762d51a58ae8300cee51","_from":".","_npmVersion":"4.6.1","_nodeVersion":"7.8.0","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"af6fe60044ebd0cec5ab762d51a58ae8300cee51","tarball":"https://registry.npmjs.org/p-one/-/p-one-1.0.0.tgz","integrity":"sha512-UqOWXzFr6ZLUydnJpYvXshJXm8Fi3rQxDfMUfu9B4XyMbfvLp8jjDismQjNTqVGr8zeZxH9uAoude/ygVwmARg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCoAKMP/3u8C2lYDDuztMt+AjjuXrLaL7F+qcQ/LKZOwIhAPASWNiaClqS4caydxFWLH3IOvA/Jcjt7OzCgRr23Sqs"}]},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-one-1.0.0.tgz_1495673157704_0.5732706380076706"},"directories":{}},"2.0.0":{"name":"p-one","version":"2.0.0","description":"Test whether some promise passes a testing function","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/p-one.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","filter","fulfilled","iterable","iterator","parallel","promise","promises","some","test"],"dependencies":{"p-map":"^2.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"fb45a85a79a87e15897cf55f42bd5157b1dda772","bugs":{"url":"https://github.com/kevva/p-one/issues"},"homepage":"https://github.com/kevva/p-one#readme","_id":"p-one@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"integrity":"sha512-MXUK2yX7G7kGcLZhmKa1GQGFamPkNHOKl6zF8Mn0Vhp6H8Hvz75nohftTn1dEQXHnVnupQagn/WtnYoIfATsJg==","shasum":"171c9249d2e4a99334bc438e02554e067d8eadbc","tarball":"https://registry.npmjs.org/p-one/-/p-one-2.0.0.tgz","fileCount":5,"unpackedSize":5131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJci28MCRA9TVsSAnZWagAAefcP/ia8iDdsC+7VzDDshr5p\nZFV0SXzsTO8iIOsqVo08lJOsX1rNv8Pe8WkuSQYYYOZB0Dw++LBmvy37u0fc\nNg9tWdhygUxT1ex30H77w+STs1couRbEmTM9lDP5VplGn9KSHIYKKOs405kt\nFPLVK3FOazStsQcUQSLEJSf2WmLgWlzuw2hrXAZwI7IS2DknFwFnKwy0lTSN\n7r90UP98sIzgJ+RiJOf9/IrSa8BNSeB+dcJjiywVqq2xIEayTO/yaJ9aXB4v\nKF2Kf1RZPWV1N1/L5CLCiumKgihxlgVGpoPnmbVxwGq5NG4buodgnCe0sYk9\nuISbpKJMjlwfb2uICVQI799053AB7MvYqYuP2LB32eTHLVlZjWdIgCdZkHjG\npS0CeQSNmIDOMngZeFSQnTv2z/Ko3j13MxqJ50MuvP7QkKb0yVrHoAyNC3P4\nzo19hn6LtwIhfk8R5tgrHx1qCECQwPuMs4sMvJEE/+iE3nGFxR5cQ3J/5wno\nsIpN1HSMtgPytLauMl0FOwOq3WeA2loBk4lN3n47r9Hb64vmnGv3b7k1gXtu\nI9qpTLevvyBiSKRAxOl0SyzeREz0g3EYChIjWlSgyr4zujnUviwsfZW77RqZ\nihePT/u52VWpmiK5Mwsu3o443nDXWdvmj/Xs8qpca86HCWKICGS7z0N0gd/V\n+6u9\r\n=nlJG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuuGgLMIY3SW8apjB9D7gxDwAg5wQslpPZX+7x+LaW2AIgbFKfwoGxhOE3xQr2yRZvyUD+LxmYJnBFxtoMSwhziVs="}]},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-one_2.0.0_1552641803964_0.9593495409640262"},"_hasShrinkwrap":false}},"readme":"# p-one [![Build Status](https://travis-ci.org/kevva/p-one.svg?branch=master)](https://travis-ci.org/kevva/p-one)\n\n> Test whether some promise passes a testing function\n\nLike [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) for promises.\n\n## Install\n\n```\n$ npm install --save p-one\n```\n\n\n## Usage\n\n```js\nconst pOne = require('p-one');\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 pOne(places, testFunction)\n\tconsole.log(result);\n\t//=> true\n})();\n```\n\n\n## API\n\n### pOne(input, testFunction, [options])\n\nReturns a `Promise` that is fulfilled when any promise 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 any promise 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\nExpected 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-every](https://github.com/kevva/p-every) - Test whether all promises passes a testing function\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","maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"}],"time":{"modified":"2022-06-23T05:49:42.612Z","created":"2017-05-25T00:45:58.648Z","1.0.0":"2017-05-25T00:45:58.648Z","2.0.0":"2019-03-15T09:23:24.145Z"},"homepage":"https://github.com/kevva/p-one#readme","keywords":["async","await","bluebird","collection","concurrency","concurrently","filter","fulfilled","iterable","iterator","parallel","promise","promises","some","test"],"repository":{"type":"git","url":"git+https://github.com/kevva/p-one.git"},"author":{"name":"Kevin Martensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"bugs":{"url":"https://github.com/kevva/p-one/issues"},"license":"MIT","readmeFilename":"readme.md"}