{"_id":"@aloreljs/awesome-iter","_rev":"4-377c1222a2a7021b4655d7006bbdc3f8","name":"@aloreljs/awesome-iter","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@aloreljs/awesome-iter","version":"1.0.0","description":"Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.","main":"index.js","module":"_esm2015/index.js","repository":{"type":"git","url":"git+https://github.com/Alorel/awesome-iter-js.git"},"types":"index.d.ts","typings":"index.d.ts","author":{"name":"Arturas Molcanovas","email":"a.molcanovas@gmail.com"},"license":"MIT","sideEffects":false,"exports":{".":{"node":"./index.js","types":"./index.d.ts","default":"./_esm2015/index.js"},"./consumers":{"node":"./consumers/index.js","types":"./consumers/index.d.ts","default":"./_esm2015/consumers/index.js"},"./pipes":{"node":"./pipes/index.js","types":"./pipes/index.d.ts","default":"./_esm2015/pipes/index.js"}},"publishConfig":{"access":"public"},"gitHead":"4d6fffa27a2bca751889f9a9b7950fcff5bd4da9","bugs":{"url":"https://github.com/Alorel/awesome-iter-js/issues"},"homepage":"https://github.com/Alorel/awesome-iter-js#readme","_id":"@aloreljs/awesome-iter@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.3.1","dist":{"integrity":"sha512-4LiRoFnVpC+qrJQmeKbG4NG7dTiUGgTsVlIEJhPStFCy4OlkSYCDnvRU2KVO4FXKJd6u7LOKE9sE67gQ+7VB8Q==","shasum":"76edec0ca578b74736bfefcf4da171f809490ff1","tarball":"https://registry.npmjs.org/@aloreljs/awesome-iter/-/awesome-iter-1.0.0.tgz","fileCount":83,"unpackedSize":68585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/qb3CRA9TVsSAnZWagAAazAP+wX5t+8POF4fc+X6fOnV\n9GS3RSfqsruH5BVAQ7ExTH8SVE2t3qnSY80MTSZd24SN/GPGQk6DLJu7yj3u\nS5bQGhGL/gPw8HDBo3NfXbR4CKqlEHGadnME7+UoTMTRtxTO57p2wEPUp74x\n0sH0k1ACXSWktSXYotLQgBrMr9o0fby/KDhHT6jFPepclXPeUyVlSGzwOlH4\nQfJaCLNOUMfvK17phuCU4jVK4QToBoa/oPMsQIFm+6x9J0WelELlupAwcx2Q\nLfprU2uoj+92eKzPnY+pupSanE5qylKI8M2gB+9BL/SEw1mZQkPsEzTMa/+5\nIb+/qwRSmTcsJjinitwGkaMd0BujAJ9VnrRFHme98O2avJ0++NeWj403u8Qi\n38te7dSJzntXZuKbQ3FGnyCtI2u2FmyDv7SFfM2KF0w7jf6yo6KbSR7Ts6hS\nWpCKIKfiN5rm3FvHwOd8zuqPWxTmBwz77kea0nJBrLPyyzDJJOUoa7wKwTIw\nl44uWopUpW5LIXZDrKj2PoRS64HIREpCt0myQrmI155xtDjh9UNK6t0FxHcy\nMQXWqAQeUyGLAmwlqnGzwqt/0/mZJEkaFDlmgv3kURVHDphS4poTFakZztRq\nwyUvfBDv43uIqpa32yzR1inQLA+nnamtZnSri0kh9brGO3nhaHnUVnudtbLF\ndLvl\r\n=bsQ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1Pi8MwZnIqUnFBkwC+bUK7Z3cabPjqzoIVB0aGS1DMAiA0SxkOWWxE1yNbhq10pwoOBJYf8cVjrsvC8qCOMPRGzQ=="}]},"_npmUser":{"name":"alorel","email":"a.molcanovas@gmail.com"},"directories":{},"maintainers":[{"name":"alorel","email":"a.molcanovas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/awesome-iter_1.0.0_1644078839292_0.1620507682041088"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aloreljs/awesome-iter","version":"1.0.1","description":"Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.","main":"index.js","module":"_esm2015/index.js","repository":{"type":"git","url":"git+https://github.com/Alorel/awesome-iter-js.git"},"types":"index.d.ts","typings":"index.d.ts","author":{"name":"Arturas Molcanovas","email":"a.molcanovas@gmail.com"},"license":"MIT","sideEffects":false,"exports":{".":{"node":"./index.js","types":"./index.d.ts","default":"./_esm2015/index.js"},"./consumers":{"node":"./consumers/index.js","types":"./consumers/index.d.ts","default":"./_esm2015/consumers/index.js"},"./pipes":{"node":"./pipes/index.js","types":"./pipes/index.d.ts","default":"./_esm2015/pipes/index.js"}},"publishConfig":{"access":"public"},"gitHead":"60f41f3ecc17f20556fcf8353cbee734c8244be8","bugs":{"url":"https://github.com/Alorel/awesome-iter-js/issues"},"homepage":"https://github.com/Alorel/awesome-iter-js#readme","_id":"@aloreljs/awesome-iter@1.0.1","_nodeVersion":"16.13.2","_npmVersion":"8.3.1","dist":{"integrity":"sha512-+QQ7au8Hb36mtTkMf+dxTxn+zAZ6SMGq1aTq9TFpbAd303cXe7ItEuSst6hO3PvRZGDsLAUJu6yTO/fBR1vhjw==","shasum":"b48f5d31661cb7b8b277d0974d76700a0a14bdf5","tarball":"https://registry.npmjs.org/@aloreljs/awesome-iter/-/awesome-iter-1.0.1.tgz","fileCount":83,"unpackedSize":68575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/qiCCRA9TVsSAnZWagAApYMQAJqOIOEHfq07HDF4xK18\n9m4R27SrwSQJHyAN9PJgjbFFvY1SlqHlWH5Ow4KfytWnSeBduj0v9mSKqnzh\nvOHxMdK/ryxhUxsBOZW0oT44f4NMp/Af9VytUGwx+p7FPGJumJGAUjMiaonU\naRpQxDtEqXQyOfJh8rXMiceVEYjIT2BTDQr3HCcb+KVbdnlMKKbgc4joOmAm\nl0ivn5zC5bqHvjCERaVF5vmLK81tahoeCMAkR1nSmyqqzACNn8+hK145CHVC\nV2h4zdepE34C4qoHYsfig6RUZzsNf7/bXmzAfQlnUcnSL/USQexva/wO+Y6z\nJ9eYdHR+nm0DHi9HTzklSGss42mBvxM1Dve/Z5dXhHNGsDFNi9lKbPaVHFxM\nw8pFlvzaBL300iRYMHJ1dcFMWDSxyE3Cnca45/7DctEBKU+ogeMZcfbRUVwf\nb7e1VAORvpIaI8qW25xI4LY5Lyq9aXIc7cVYwOT/zhRmslRUQaQ5wr9dUgqX\n4qDP31YvhrA84sNKd1eI23xlV1U4nuCBHYDLOGYpeqzoLGR/8CzEqDsZBL6g\nR3zweIN02HquOkT+h+4+rzZ5rD6yFaTUKOm+oC2kU0jLeAun/zXPAZ9E70tN\nzxpRdxi/VAtsVt/6w+L/LxE9+jxnwuYEICUVfTp7mjtXUAi/c893jaM5qWF9\nqwn5\r\n=D5ea\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzb8hT/bKbKKI5Fr0VVGpn/p+Gt1dcsau0Qnm2wK18IAiAJ2h+92gecTzuhO3v+l1x2tYZjG/zH66knySLHSCGJlw=="}]},"_npmUser":{"name":"alorel","email":"a.molcanovas@gmail.com"},"directories":{},"maintainers":[{"name":"alorel","email":"a.molcanovas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/awesome-iter_1.0.1_1644079234823_0.07716872631740457"},"_hasShrinkwrap":false},"1.0.2":{"name":"@aloreljs/awesome-iter","version":"1.0.2","description":"Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.","main":"index.js","module":"_esm2015/index.js","repository":{"type":"git","url":"git+https://github.com/Alorel/awesome-iter-js.git"},"types":"index.d.ts","typings":"index.d.ts","author":{"name":"Arturas Molcanovas","email":"a.molcanovas@gmail.com"},"license":"MIT","sideEffects":false,"publishConfig":{"access":"public"},"gitHead":"9ccb3b6aff76162f78e9058400c92dded6b1ae59","bugs":{"url":"https://github.com/Alorel/awesome-iter-js/issues"},"homepage":"https://github.com/Alorel/awesome-iter-js#readme","_id":"@aloreljs/awesome-iter@1.0.2","_nodeVersion":"16.13.2","_npmVersion":"8.3.1","dist":{"integrity":"sha512-Exd2cM44yAGnyEEqF8NSVlywcmi9WkCotaF1RKtbas8f2nD8UetZkj+6B3V/sM9rdMyEpBSshh2dxUUqmnFaMA==","shasum":"cae1405ec56986fb9da8f41c315b97493bf63621","tarball":"https://registry.npmjs.org/@aloreljs/awesome-iter/-/awesome-iter-1.0.2.tgz","fileCount":83,"unpackedSize":68144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAqMmCRA9TVsSAnZWagAAA7wP/1RY+7voHMnS6uZCo+gt\nHiphcWhi1gOjvPNyQinDT6agOqNh/bSRQMtLHe8JncSpzvxQ9sNK1d3RDEub\nyAwk8oIrK4MDvHBVOzJeReeDiF3MXypuotsHHObN4p1YzppoSaCd3e4Qwjae\nVIMWFyuKlx1IcFfTv9onvIT27BHNqAe1PT5ZKCP0U0kUjRMK3lGwXyQdyL5F\ngnB/nbWEj7aahtMkoKhbQ6uBFTybKt+iM1HWK0lygK3JFsrgKMHRudimjL/2\n5dZIfZ06Zul/NrpCtRjyxu2X0nmYPHOeFPcVJ5NPaMiT7nvOr+nvOoo9RSZf\nhaKhxlbQHafhtnCgzFR1jFJgRRGu9vkgFGociVfS0rE0vyA9FdLJYy5pJhqe\n3fFBhxkED37GJIOo1lPjHPYjdY1JCRsQ1VtWy14gJxR8eEJLVZxqdeWdaNEN\n7zlxcVEA7j37SQj12IbYjnlb+tPXaEc4K9s5OwoyrJ3Up2cPPZxeXz+4sKfN\n3XjODNDtxdJLiC9uXoZwwx2op6Cq5/qeuee9Bnftjuv4C5uoSiVe0H3r3mkV\nzWLkjlqQ0H7eLFBzU/GJBeq0yI6CHlGsWMKUKUWQ3/pl5B9DJHU5T1EVXCXo\neZKABYCOnxupiRVMu9VLxq4vCnM8OyDibK/Yw93fUp5Z9F4CXgndbGEsGxUc\nbxx0\r\n=tzKC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChGSSRfrN7QiHdCD4jPrMWaY8LFvCr2tRnbYM3X7+V5gIhAL9qVZoMFLfM0nEryHU9x9DUBvETnnxFsm+3TeWva+Av"}]},"_npmUser":{"name":"alorel","email":"a.molcanovas@gmail.com"},"directories":{},"maintainers":[{"name":"alorel","email":"a.molcanovas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/awesome-iter_1.0.2_1644340006176_0.8737468677642617"},"_hasShrinkwrap":false},"1.0.3":{"name":"@aloreljs/awesome-iter","version":"1.0.3","description":"Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.","main":"index.js","module":"_esm2015/index.js","repository":{"type":"git","url":"git+https://github.com/Alorel/awesome-iter-js.git"},"types":"index.d.ts","typings":"index.d.ts","author":{"name":"Arturas Molcanovas","email":"a.molcanovas@gmail.com"},"license":"MIT","sideEffects":false,"exports":{".":{"node":"./index.js","types":"./index.d.ts","default":"./_esm2015/index.js"},"./consumers":{"node":"./consumers/index.js","types":"./consumers/index.d.ts","default":"./_esm2015/consumers/index.js"},"./pipes":{"node":"./pipes/index.js","types":"./pipes/index.d.ts","default":"./_esm2015/pipes/index.js"}},"publishConfig":{"access":"public"},"gitHead":"af952e21f90a33effc7039ab9b43a63b638f2ac1","bugs":{"url":"https://github.com/Alorel/awesome-iter-js/issues"},"homepage":"https://github.com/Alorel/awesome-iter-js#readme","_id":"@aloreljs/awesome-iter@1.0.3","_nodeVersion":"16.13.2","_npmVersion":"8.3.1","dist":{"integrity":"sha512-RDxo7Hpi61YJeua2SdJ6yv7tfwS7Wq789/FGB+EX3Jc8FfCnFz/s7XEf60576Zwb2UMh9f9VVEqul1h80o58qA==","shasum":"c311730ced736bb1a630a15c7ff981249111df33","tarball":"https://registry.npmjs.org/@aloreljs/awesome-iter/-/awesome-iter-1.0.3.tgz","fileCount":83,"unpackedSize":68571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAqyMCRA9TVsSAnZWagAAxh0P/2VrdMxjDDQe4V6tPeyo\nNYF71iKh+28PILkRv+xLNTYRkStmWNtEc+BGQczKdwZYUlgDpb84fPoLH+/K\ny0bFDd168Zr2z4+clCcqg4G9cd1Z7FX7k0FYMCBAp2XgVrnG8/4rDsWDWkKe\ns4QYz2wV7KigUGT0/O0Kqua2M7tPoP/dCj58VgHRMVRkj4IXCduRYfoUmstR\n7QMDw4Ze9oBpRHzCcylYLpvIwYi3W7z6MpQoK2TE3WAL9VSg8Y4Me6BiyYJb\nDG9tmHQQXWoJ3QuusWZJEbBNB22bsGBijNoKfqq98y/Fps8OEHOoCI+9/pjc\nq2xmN2RiI2YIU7TxpkAPB36lHN8rieMXz/zKkIR3Dvxs+i2a34dPY9DvOmAZ\n9x1KMY2rrPjPyTMTEQzDUToks0eECFRsGLl+EjUWwvQ9002RCE1Y7u2YBb/t\nbc1ET+xdYI2L99odJxxUA12RpejX+37nFfa+oEL6SLWH+OPfAuQZaJZoLGiz\nNRt7pOnPVxE1MmvGYgpIBsSgdQneItZmQwFG5SeKbvqy44xnkUonvgViVWEu\nt7zkA+jLGNfQcNOY3XBE6UcE3fgkgUa7/T3hvfkQByZKnojJpMPe85QFkiH0\nFqafKa8QDGU6logW0Qc1LAROc0CdB8UdEkJxJNYlUfelzreLm35ayoTFrdm7\nD/Mu\r\n=6hRj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVb7zpHnvntK+cZVRWWCa+w8ekGwVkfJEeen9VsCreuAiEAnN/9vonpDsjYNvIqeydGlFV/fDRvbakZwQ3ERiWXLH0="}]},"_npmUser":{"name":"alorel","email":"a.molcanovas@gmail.com"},"directories":{},"maintainers":[{"name":"alorel","email":"a.molcanovas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/awesome-iter_1.0.3_1644342412511_0.3241079173759396"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-05T16:33:59.066Z","1.0.0":"2022-02-05T16:33:59.447Z","modified":"2022-04-04T13:37:27.395Z","1.0.1":"2022-02-05T16:40:34.979Z","1.0.2":"2022-02-08T17:06:46.305Z","1.0.3":"2022-02-08T17:46:52.665Z"},"maintainers":[{"name":"alorel","email":"a.molcanovas@gmail.com"}],"description":"Gives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.","homepage":"https://github.com/Alorel/awesome-iter-js#readme","repository":{"type":"git","url":"git+https://github.com/Alorel/awesome-iter-js.git"},"author":{"name":"Arturas Molcanovas","email":"a.molcanovas@gmail.com"},"bugs":{"url":"https://github.com/Alorel/awesome-iter-js/issues"},"license":"MIT","readme":"# awesome-iter\n\nGives iterables & iterators a facelift by allowing you to manipulate them like an array or stream of values.\n\n```bash\nnpm install @aloreljs/awesome-iter\n```\n\n\n[![CI](https://github.com/Alorel/awesome-iter-js/workflows/Core/badge.svg?branch=master)](https://github.com/Alorel/awesome-iter-js/actions?query=branch%3Amaster+)\n[![Coverage Status](https://coveralls.io/repos/github/Alorel/awesome-iter-js/badge.svg?branch=master)](https://coveralls.io/github/Alorel/awesome-iter-js)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Alorel/awesome-iter-js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Alorel/awesome-iter-js/context:javascript)\n\n-----\n\n# Table of Contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Motivation](#motivation)\n- [Alternatives](#alternatives)\n- [API](#api)\n  - [AwesomeIter](#awesomeiter)\n    - [constructor()](#constructor)\n    - [pipe()](#pipe)\n    - [consume()](#consume)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n# Motivation\n\nArrays have useful functions, iterables don't. While you could just transform an iterable into an array, that results\nin multiple iterations:\n\n```typescript\nconst someSet: Set<string> = getSomeSet();\nconst uppercased: Set<string> = new Set(\n    [...someSet] // first full iteration\n        .filter(str => str !== 'foo') // second full iteration\n        .map(str => str.toUpperCase()) // third, partial iteration\n); // fourth partial iteration to construct the Set\n```\n\nThis library allows you to work with iterables directly:\n\n```typescript\nimport {AwesomeIter} from '@aloreljs/awesome-iter';\nimport {concat, filter, map} from '@aloreljs/awesome-iter/pipes';\nimport {toSet} from '@aloreljs/awesome-iter/consumers';\n\nconst someSet: Set<string> = getSomeSet();\nconst someMap: Map<number, string> = getSomeMap();\nconst someArray: string[] = getSomeArray();\n\n// Only 1 iteration over someSet, someMap & someArray\nconst uppercasedSet: Set<string> = new AwesomeIter(someSet)\n    .pipe(\n        concat(someMap.values(), someArray),\n        filter(str => str !== 'foo'),\n        map(str => str.toUpperCase()) // Only gets called `length - numberOfFoos` times\n    )\n    .collect(toSet()); // Set is populated as values get yielded\n```\n\n# Alternatives\n\n- For any async data just use [Rxjs](https://www.npmjs.com/package/rxjs) - it's awesome & it has more functionality.\n- I'm unaware of similar libraries for synchronous iterables & iterators. This one is very lean & tree-shakeable!\n\n# API\n\n## AwesomeIter\n\n### constructor()\n\nJust pass an `Iterable` or `Iterator` and `AwesomeIter` will be able to start managing it.\n\n### pipe()\n\nPipes manipulate the source `Iterable` or `Iterator` in some way - filter results, map them to different values etc.\nEach pipe has documentation & examples written for it in the\n[projects/awesome-iter/pipes](https://github.com/Alorel/awesome-iter-js/tree/master/projects/awesome-iter/pipes)\ndirectory and is imported from `@aloreljs/awesome-iter/pipes`, e.g.\n\n```typescript\nimport {filter} from '@aloreljs/awesome-iter/pipes';\n```\n\nThe current list of pipes is as follows:\n\n- `chunk`\n- `concat`\n- `distinct`\n- `filter`\n- `map`\n- `sequentiallyDistinct`\n- `skip`\n- `take`\n- `tap`\n\n### consume()\n\nConsumers consume the source `Iterable` or `Iterator` & produce a single result - these include functions like those\nin `Array.prototype` that don't necessarily return an array & functions for collecting the source into some JS\ncollection. Each consumer has documentation & examples written for it in the\n[projects/awesome-iter/consumers](https://github.com/Alorel/awesome-iter-js/tree/master/projects/awesome-iter/consumers)\ndirectory and is imported from `@aloreljs/awesome-iter/consumers`, e.g.\n\n```typescript\nimport {some} from '@aloreljs/awesome-iter/consumers';\n```\n\nThe current list of consumers is as follows:\n\n- `count`\n- `find`\n- `first`\n- `includes`\n- `last`\n- `reduce`\n- `some`\n- `split`\n- `toArray`\n- `toMap`\n- `toObject`\n- `toSet`\n","readmeFilename":"README.md"}