{"_id":"random-array-iterator","_rev":"2-3a1b78f1a1893bf911f9424d7ff94847","name":"random-array-iterator","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"random-array-iterator","version":"0.0.0","description":"An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration","main":"index.js","dependencies":{},"devDependencies":{"standard":"^16.0.3","tape":"^5.0.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/random-array-iterator.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/random-array-iterator/issues"},"homepage":"https://github.com/mafintosh/random-array-iterator","gitHead":"8a89e99411980e78c373bd21f7105d39669385b3","_id":"random-array-iterator@0.0.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-VRZSIoPAfsmuUERM60RHZEIVtODrr3fu01DYsCvrP9Lpj3ah5RbvCLVnsVFArFQWQ9FP7ED26Ad6OKktwdLISQ==","shasum":"2c7454b540fcc56a9f47d266105d346bf6f53571","tarball":"https://registry.npmjs.org/random-array-iterator/-/random-array-iterator-0.0.0.tgz","fileCount":6,"unpackedSize":6045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSsBCRA9TVsSAnZWagAAPpsQAJvoEoH8pcFYuFNtOjNc\nHPKvpwk61boH3etAxsP+vavNYaD11K/okA04B1dbPdrirvpBmo+DfgXmT5WV\nPSx5knmYMy7bnEp4A8ajC/Fbyo2gT//r398h2QNtWY6bi5Bg4za0EMR4ImLs\nuxxvRUmTljvZcqdgzOibihPqWIU9T4fjGfw+OF4W1OFHOEt7Q3tcK3KPlEVs\n5InNx8vImQOz7L2jLWTgIuXW/cN4wq/Aajf+mahBDQFFb6JobWVwUykCFf5J\nrwGzBEaU/yme+nirne8f8HYNFlJRUmre5+hHpO3MOSymGGA4Qq4VumPB/D+t\nL9wVaV0XtqWI8+zEgmXCZe9S1GqKr6PL8ExkeoZ4B8o0tqhrIwxTE1idqz1T\n4+CpKEAVwRN8kImA0YiDT0+zkp/9g12XbRcKOLoaYLJYz54DuFdcOCn0gxBe\nn9b7cPdSr4X6OUC+Z9P0aJMzFb4ZHj7BTNeMh8PZu3lZnblNdFh0ELFmeJkA\nir6uLGlhnI38vyQed4Iu/jVIszmtQReHsQlH1c1nzUMEoQRvH8UjUFwkPg7n\nOVghIDoTb/Y7ROsPL5QgKCKzJrL89fwYlMEWFItSP6+snD9AyW0HASwRsfPn\nd2kkoELlCzs7Q5H10j5FymK0r/ksDG8Nb4phO+x1rD5R5/R9rAGDQBKklbXk\n5RhC\r\n=2uGN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8lfuZnqnQ7l5P2zVKz0POc9cYvEpyWxxhnf8wEhum7AiAeI4HCdRU5VKYg89aJDxblBOnco+TE6hi+WNB0IOjhOw=="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-array-iterator_0.0.0_1606757121198_0.12386224443762672"},"_hasShrinkwrap":false},"1.0.0":{"name":"random-array-iterator","version":"1.0.0","description":"An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration","main":"index.js","dependencies":{},"devDependencies":{"standard":"^16.0.3","tape":"^5.0.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/random-array-iterator.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/random-array-iterator/issues"},"homepage":"https://github.com/mafintosh/random-array-iterator","gitHead":"072f6d23b791975ad9dad34b0c29b87eb231c6e5","_id":"random-array-iterator@1.0.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-u7xCM93XqKEvPTP6xZp2ehttcAemKnh73oKNf1FvzuVCfpt6dILDt1Kxl1LeBjm2iNIeR49VGFhy4Iz3yOun+Q==","shasum":"1081f8922d68d2817368c13028f858ec308e146b","tarball":"https://registry.npmjs.org/random-array-iterator/-/random-array-iterator-1.0.0.tgz","fileCount":6,"unpackedSize":6045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxSs1CRA9TVsSAnZWagAAjFgP/ROii5NFYQnTM7y1tD4T\n27rXrsdB1zf4L6uIWpJrrCStXKa/3uiqVmf14S1F5mylYxzJ0jl/oL6q9XzD\nXfWKEJKZSAgR9JiMwoCbxaAofgLl8l5TrTrTOEGaP3tVbYvyJrW4RTaL1zsD\nT8tGHg/9yJN4UtkmwPXqYzap7rrIg1jNWgJcql/1ze0D4GJ0OLwfqbYLQ48C\nrRcshTmpEy37H4/Aw3mCroQRbWiDRZtiilf4p4quzIoz1k7dJ4dnXKRyk1Er\nOiVe/DLtROQuoASR+5O7sIPZjShTC7sHXJkrMVT4RwH5cBZOz1yXf+nDyyfW\nLB+ihbUaHwdp6nHgYyGC7fiuA9291MmSOBHc9F+FoRNdhEbMGEcfFZdP1+yf\nCbyIe1wMTeCyPN1eYdNY8O2eL6S3sHoQAKxlXmP3T5JJMqsTooI5Ajk+Hnnf\n1BvKFO0Ramen3qRWa98BL0zce9LNVUgfJJK+U+2c5r0XgKPf58rxZT7KiV8M\nUBYghSfUuZoVLH2seEAUfc/bR2eDn4IB/7+Igq7HsVzQuGWJgDaxHlI9Rgzx\nsuAVfl5AoZLv4avrDdI2Xqrlx87vZJ/VTetRz+kcJdKuW2p5BweTKioVSKB7\n18B0PFErGMu8QCUgKa43xtSYayOmQuAZXAFR3ry8/pxdmUsm8yva4D8let+4\nVinL\r\n=oZTs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqgQFE45NetRjgtRU8nifEWRrvjsGWvT3erW7RFs85qAiEAn2nEk3GOSVC0C2YtHSBZ3TS2nffynhjGh0NNJh0jMqw="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/random-array-iterator_1.0.0_1606757173003_0.9088675427573221"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-30T17:25:21.198Z","0.0.0":"2020-11-30T17:25:21.313Z","modified":"2022-05-14T02:07:33.038Z","1.0.0":"2020-11-30T17:26:13.168Z"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"description":"An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration","homepage":"https://github.com/mafintosh/random-array-iterator","repository":{"type":"git","url":"git+https://github.com/mafintosh/random-array-iterator.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/random-array-iterator/issues"},"license":"MIT","readme":"# random-array-iterator\n\nAn iterator to iterate an array in random order with controls to requeue or dequeue\nelements during the iteration.\n\n```\nnpm install random-array-iterator\n```\n\n## Usage\n\n``` js\nconst RandomArrayIterator = require('random-array-iterator')\n\nconst ite = new RandomArrayIterator([1, 2, 3, 4, 5])\n\nfor (const val of ite) {\n  console.log(val) // random value\n\n  // call requeue if you want to revisit this value is the same iteration\n  if (someCondition) ite.requeue()\n\n  // call dequeue if you want to remove the value from the iteration and array entirely\n  if (someOtherCondition) ite.dequeue()\n}\n```\n\n## API\n\n#### `ite = new RandomArrayIterator(array)`\n\nMake a new iterator. Implements the JavaScript iterator interface.\n\n#### `ite.requeue()`\n\nRequeue the current value. Only valid to call during an iteration.\n\n#### `ite.dequeue()`\n\nRemove the current value from the array and iteration. Only valid to vall during an iteration.\n\n#### `ite.restart()`\n\nRestarts the iterator.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}