{"name":"it-first","version":"1.0.0","description":"Returns the first result from an async iterator","main":"index.js","scripts":{"test":"nyc --check-coverage --lines 100 --reporter html --reporter lcov ava","lint":"standard","coveralls":"npm test && cat ./coverage/lcov.info | coveralls"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/achingbrain/it-first.git"},"bugs":{"url":"https://github.com/achingbrain/it-first/issues"},"homepage":"https://github.com/achingbrain/it-first#readme","devDependencies":{"ava":"^2.4.0","coveralls":"^3.0.2","nyc":"^14.0.0","standard":"^14.3.1"},"gitHead":"65ff454a9f0bdb4336c78bb1ef640ccb69625fae","_id":"it-first@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-cPj/o37iIJ6S0OJ8vWQraifQwVAixFAlkjnAe7Vk2oQj4UkwDUo3xZQoH6r9bWMjV6UMRuaiXoYTwDifOwKz+A==","shasum":"ed142fbdad62d684efce9cc3e42df23f0426ee42","tarball":"http://registry-npm.ywwl.com/it-first/download/it-first-1.0.0.tgz","fileCount":5,"unpackedSize":2037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd273xCRA9TVsSAnZWagAAyngP/R5gU6nUVxdxsv8zP9xh\nnk7mT9H6JaFoWPEQnARh4kqNHRq4jIbBzpJSNHZCsUMRzAzhr+qYNZdQo2xe\nvab5YznkK0ea+BS+g0WsWYd/2ikh5cRTbAz2UQXEpqatVuyjneDDvd1z5Ifx\nDRYKkpfT395Ik90vlrqH3In3SLkOQiN7m1RZ2iSmfQyTOD6o5S6kqf4LmoUo\nReg3rf0ZmQ8LVkCIFpQYiTCjy5sZRx56Lqp9rED4MBwRbrwzKrSNUyYq6vYP\nhFeDKpkLle3JqNT9Nf0/sKQCpzAfcKa5shQm4lqNStEcr7swnP9U6rsBXIgg\nb9TGToQ7CTEpb1GVe8MuPSg2qv5Lys/X3aeGOpmrKT1dBi6io7IhghB5u20M\nMoHgnf07H4pvTVNuho0rWjVVMUNmNC/oh5bfkj9IHtETPGh+vmkIM4qo74RW\ntVjEEI1muCkszVWE2y9hIolPTqBV4UXNwhCghvMAG3WxAxC4h0OSsScHOIY3\nh/t28UksTS0fnx2NMoiYUw3GB36ZI8a/12lSpxuEIZc4HSjQ+Uniyrpu9r3f\nxl5lh/G+gTAJL03ar/llik2CdhgbFOtoPcHQZ0JMtA+1y5j7bI6XU/Mmxk1z\nyeNM3dst/5vTYK5AgWs2WqHDZB17Qn1OeteV2c/IenOsJYNcsakevWimh58X\n5mfU\r\n=jOwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYcsG6TBNiieqQaiUhbE4J+j/n3E0mFJtYLu/K7mhKjAiEAnHrIQmD/ronWEU0/6GEmBCIbmn70qivIB1MRIgZYHK4="}],"size":1071,"noattachment":false,"key":"/it-first/-/it-first-1.0.0.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-first_1.0.0_1574682097195_0.42293014365962067"},"_hasShrinkwrap":false,"readme":"# it-first\n\n[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)\n[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Returns the first result from an async iterator\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nReturn the first value in an (async)iterable\n\n## Example\n\n```javascript\nimport first from 'it-first'\n\n// This can also be an iterator, generator, etc\nconst values = [0, 1, 2, 3, 4]\n\nconst res = first(values)\n\nconsole.info(res) // 0\n```\n\nAsync sources must be awaited:\n\n```javascript\nimport first from 'it-first'\n\nconst values = async function * () {\n  yield * [0, 1, 2, 3, 4]\n}\n\nconst res = await first(values())\n\nconsole.info(res) // 0\n```\n\n# Install\n\n```console\n$ npm i it-first\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItFirst` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-first/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/it_first.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/it-first/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-first/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1574682097286,"_cnpm_publish_time":1574682097286,"dist-tags":{"latest":"3.0.11"}}