{"name":"it-foreach","version":"0.1.1","description":"Invokes the passed function for each item in an iterable","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"homepage":"https://github.com/achingbrain/it/tree/master/packages/it-foreach#readme","bugs":{"url":"https://github.com/achingbrain/it/issues"},"scripts":{"test":"ava","lint":"standard","coverage":"nyc --reporter html --reporter lcov ava","clean":"rm -rf .nyc_output coverage dist","check":"tsc --noEmit","build":"npm run build:types","build:types":"tsc --emitDeclarationOnly --declarationDir dist","prepublishOnly":"npm run build"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"ISC","devDependencies":{"ava":"^3.12.1","it-all":"^1.0.6","nyc":"^15.1.0","standard":"^16.0.3","typescript":"^4.0.2"},"types":"dist/index.d.ts","gitHead":"9a1ec79746fe9efa8cf8835da3817c427f901dc2","_id":"it-foreach@0.1.1","_nodeVersion":"16.13.0","_npmVersion":"lerna/4.0.0/node@v16.13.0+x64 (darwin)","dist":{"integrity":"sha512-ZLxL651N5w5SL/EIIcrXELgYrrkuEKj/TErG93C4lr6lNZziKsf338ljSG85PjQfu7Frg/1wESl5pLrPSFXI9g==","shasum":"8dce2d16567cfac007977e2daae7699c82c58d70","tarball":"http://registry-npm.ywwl.com/it-foreach/download/it-foreach-0.1.1.tgz","fileCount":7,"unpackedSize":3528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3ZITCRA9TVsSAnZWagAAZJUP/RWxIMDJ3MGWyYXLYTKo\nGmHcyI8Q3MfufA/aguQznoxOyp/NUHf1wtDNKCy9M78NXUcyaGs7CYkjowYv\nxnnizFrupqNsZwu2yeMKHwtX8QiNwO53t7KVx+YNPzUBTiNNJ6GWRTrWxecH\nohqDJC9qTdxPeDpI+9+uqMbJzAD16caM0PQy+W2OWLjsTiwxnKuh6UYGI5JZ\nDl6q59LPFVMnKKgrJxm8rfWJLlBXsLFHj3xVMT9tzICJzGXQ5XJyByBAutIf\nfLhL63cA4ZRauxBy4mW4AstS6YCU/dQLot0GfRaDEl7iMnFxmctom67d2ym8\nUPopbc9QynrvDnGVk7zhZaq6scBd0ltf5DD2YIUB70KWYLbOzCBU7fx5uzsS\nkwodMXur+Jl04kfUqc54vRo3mThHn8Urby1wsLc3BmOfgHCZ2IJDV4UgnwMw\nXjvMGSvDm3y97mLs8EI/KcXpbjaTPBXdgcqtXC3/2URdr4GC6DVgvmH894I5\n5OOdyfzwol4nPCCDlEAEnvMVQ5Roi+5R757WBA0kcNqI73VgqyZpcAPH2ptr\nS8K4p/rqlpClfxVFABpkxY78O8PsIEk4x5BRJ3goBBtDQ2IHD/2Y4EFN2WJJ\nFuQE2TxGsZzZtF0H9K7lkert09HYLcuLmhqHipW4y66EQEyuF0QFWfqX9igz\nVpOx\r\n=luXM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/m00Lt+VQ+rEGz1frJS7Q4rr7pIaZhtTZYenzenNVDAIhAI5SurxnuCtN9S2WJXRLNEB8tVghKuKunlB3fdCT2Y5V"}],"size":1703,"noattachment":false,"key":"/it-foreach/-/it-foreach-0.1.1.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-foreach_0.1.1_1641910803017_0.2198364334004974"},"_hasShrinkwrap":false,"readme":"# it-foreach\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> Invokes the passed function for each item in an iterable\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\nCalls a function for each value in an (async)iterable.\n\nThe function can be sync or async.\n\nAsync functions can be awaited on so may slow down processing of the (async)iterable.\n\n## Example\n\n```javascript\nimport each from 'it-foreach'\nimport drain from 'it-drain'\n\n// This can also be an iterator, generator, etc\nconst values = [0, 1, 2, 3, 4]\n\n// prints [0, 0], [1, 1], [2, 2], [3, 3], [4, 4]\nconst arr = drain(\n  each(values, console.info)\n)\n```\n\nAsync sources and callbacks must be awaited:\n\n```javascript\nimport each from 'it-foreach'\nimport drain from 'it-drain'\n\nconst values = async function * () {\n  yield * [0, 1, 2, 3, 4]\n}\n\n// prints [0, 0], [1, 1], [2, 2], [3, 3], [4, 4]\nconst arr = await drain(\n  each(values(), console.info)\n)\n```\n\n# Install\n\n```console\n$ npm i it-foreach\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `ItForeach` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/it-foreach/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/it_foreach.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-foreach/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-foreach/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":1641910803134,"_cnpm_publish_time":1641910803134,"dist-tags":{"latest":"2.1.7"}}