{"id":22945131,"url":"https://github.com/seregpie/lodash.combinations","last_synced_at":"2025-07-03T17:33:32.212Z","repository":{"id":71672037,"uuid":"75658764","full_name":"SeregPie/lodash.combinations","owner":"SeregPie","description":"Calculates all possible combinations without repetition of a certain size.","archived":false,"fork":false,"pushed_at":"2022-06-05T10:05:35.000Z","size":28,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T12:11:43.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/SeregPie.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-05T19:27:28.000Z","updated_at":"2025-02-05T02:35:24.000Z","dependencies_parsed_at":"2023-03-16T20:45:41.222Z","dependency_job_id":null,"html_url":"https://github.com/SeregPie/lodash.combinations","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"96f436c9c394f4577b6f27c498bdf4bcd4aabc12"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SeregPie/lodash.combinations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeregPie%2Flodash.combinations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeregPie%2Flodash.combinations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeregPie%2Flodash.combinations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeregPie%2Flodash.combinations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeregPie","download_url":"https://codeload.github.com/SeregPie/lodash.combinations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeregPie%2Flodash.combinations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263369904,"owners_count":23456384,"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-14T14:29:48.850Z","updated_at":"2025-07-03T17:33:32.164Z","avatar_url":"https://github.com/SeregPie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lodash.combinations\n\n`_.combinations(collection, k)`\n\nCalculates all possible combinations without repetition of a certain size.\n\n| argument | description |\n| ---: | :--- |\n| `collection` | A collection of distinct values to calculate the groups from. |\n| `k` | A number as the size of each group. |\n\nReturns the calculated groups as an array of arrays.\n\n## setup\n\n```shell\nnpm i lodash.combinations\n```\n\n---\n\n```javascript\nimport 'lodash.combinations';\nimport _ from 'lodash';\n```\n\n\n### CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/lodash\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/lodash.combinations\"\u003e\u003c/script\u003e\n```\n\n## usage\n\n```javascript\nlet combinations = _.combinations([true, {a: 1}, null], 2);\n// =\u003e [[true, {a: 1}], [true, null], [{a: 1}, null]]\n```\n\n---\n\nCalculate all possible combinations of all possible sizes.\n\n```javascript\nlet combinations = _.flatMap([2, 4, 6], (v, i, a) =\u003e _.combinations(a, i + 1));\n// =\u003e [[2], [4], [6], [2, 4], [2, 6], [4, 6], [2, 4, 6]]\n```\n\n## see also\n\n- [lodash.permutations](https://github.com/SeregPie/lodash.permutations)\n- [lodash.multicombinations](https://github.com/SeregPie/lodash.multicombinations)\n- [lodash.multipermutations](https://github.com/SeregPie/lodash.multipermutations)\n- [lodash.product](https://github.com/SeregPie/lodash.product)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseregpie%2Flodash.combinations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseregpie%2Flodash.combinations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseregpie%2Flodash.combinations/lists"}