{"id":22356837,"url":"https://github.com/ayamflow/infinite-random-list","last_synced_at":"2025-10-26T21:43:49.512Z","repository":{"id":57273646,"uuid":"93796801","full_name":"ayamflow/infinite-random-list","owner":"ayamflow","description":"An infinite list of shuffled elements","archived":false,"fork":false,"pushed_at":"2018-03-27T18:24:14.000Z","size":4,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-23T17:36:14.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayamflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-08T22:27:46.000Z","updated_at":"2023-03-08T05:08:24.000Z","dependencies_parsed_at":"2022-09-17T02:23:00.298Z","dependency_job_id":null,"html_url":"https://github.com/ayamflow/infinite-random-list","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Finfinite-random-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Finfinite-random-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Finfinite-random-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Finfinite-random-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayamflow","download_url":"https://codeload.github.com/ayamflow/infinite-random-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228054505,"owners_count":17862129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T14:12:11.204Z","updated_at":"2025-10-26T21:43:44.443Z","avatar_url":"https://github.com/ayamflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\ninfinite-random-list\n===\n\n### An infinite list of shuffled elements ∞\n\nTakes a reference set of items , returns a random item from this array, infinitely. Never pass 2 identical items in a row.\n\n- non-deterministic\n- goes through a full set before shuffling again\n- will `slice()` the given array\n\nUseful for generating an infinite grid based on different patterns/positions, or showing random informations without showing the same item multiple times.\n\n### Installation :package:\n\n`npm i infinite-random-list -S`\n\n### Usage \u0026 example :floppy_disk:\n\n```\n    import InfiniteRandomList from 'infinite-random-list'\n\n    let list = new InfiniteRandomList(['Emma', 'Hannah', 'Alex', 'Mia'])\n    list.get() // 'Alex'\n    list.get() // 'Mia'\n    list.get() // 'Emma'\n    list.get() // 'Hannah'\n    // shuffles again here\n    list.get() // 'Mia'\n    list.get() // 'Alex'\n    ...\n```\n\n* `new InfiniteRandomList(items)`\nReturns a list instance populated with `items`.\n\n* `list.set(items)`\nSets **items** (Array) as the reference items.\n\n* `list.get()`\nReturns one item from the original set (passed using `list.set(items)` or the constructor). Always returns something (i.e. the list doesn't get empty). Always return a different item.\n\n### License :pencil:\nMIT.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayamflow%2Finfinite-random-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayamflow%2Finfinite-random-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayamflow%2Finfinite-random-list/lists"}