{"id":16410230,"url":"https://github.com/danasilver/random-subsets","last_synced_at":"2026-05-16T04:35:45.191Z","repository":{"id":21698885,"uuid":"25020252","full_name":"danasilver/random-subsets","owner":"danasilver","description":"Create a set of random-ordered subsets.","archived":false,"fork":false,"pushed_at":"2014-10-11T05:23:57.000Z","size":128,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T00:42:10.524Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danasilver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-10T04:23:40.000Z","updated_at":"2014-10-10T04:23:55.000Z","dependencies_parsed_at":"2022-07-23T15:47:20.286Z","dependency_job_id":null,"html_url":"https://github.com/danasilver/random-subsets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danasilver%2Frandom-subsets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danasilver%2Frandom-subsets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danasilver%2Frandom-subsets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danasilver%2Frandom-subsets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danasilver","download_url":"https://codeload.github.com/danasilver/random-subsets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405408,"owners_count":19796186,"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-10-11T06:23:34.661Z","updated_at":"2026-05-16T04:35:40.166Z","avatar_url":"https://github.com/danasilver.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## random-subsets\n\nCreate a set of random-ordered subsets.\n\n### `random-subsets(array[, subsetSize])`\n\n`subsetSize` defaults to 2.\n\nReturns an array of subarrays of size `subsetSize`.  The elements of the\nsubarrays are in random order.  If `array.length` does not divide evenly into\n`subsetSize` the last subarray of the result will have length\n`array.length % subsetSize`.\n\nPreserves the size and order of the input array.\n\n### Examples\n\n#### Basic use\n```js\nvar subsets = require('random-subsets');\n\nsubsets([1, 2, 3, 4]);\n//=\u003e [[3, 4], [2, 1]]\n```\n\n#### Specify `subsetSize`\n```js\nvar subsets = require('random-subsets');\n\nsubsets([1, 2, 3, 4], 1);\n//=\u003e [[4], [2], [3], [1]]\n```\n\n#### Subset size doesn't divide evenly\n```js\nvar subsets = require('random-subsets');\n\nsubsets([1, 2, 3, 4], 3);\n//=\u003e [[4, 2, 3], [1]]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanasilver%2Frandom-subsets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanasilver%2Frandom-subsets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanasilver%2Frandom-subsets/lists"}