{"id":16170408,"url":"https://github.com/corentinth/kombi","last_synced_at":"2025-04-07T07:29:14.256Z","repository":{"id":57289520,"uuid":"351743334","full_name":"CorentinTh/kombi","owner":"CorentinTh","description":"Simple object and array cartesian combination generator (for node, typescript and the browser)","archived":false,"fork":false,"pushed_at":"2021-03-26T22:12:20.000Z","size":156,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T13:19:29.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/CorentinTh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-26T10:26:17.000Z","updated_at":"2023-11-13T05:55:12.000Z","dependencies_parsed_at":"2022-09-20T08:00:35.766Z","dependency_job_id":null,"html_url":"https://github.com/CorentinTh/kombi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fkombi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fkombi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fkombi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fkombi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorentinTh","download_url":"https://codeload.github.com/CorentinTh/kombi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247611183,"owners_count":20966488,"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-10T03:18:40.552Z","updated_at":"2025-04-07T07:29:14.239Z","avatar_url":"https://github.com/CorentinTh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n\n  ![logo](.github/logo.png)\n  \n\u003c/div\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\n  [![Weekly Downloads](https://img.shields.io/npm/dw/kombi.svg)](https://www.npmjs.com/package/kombi) \n  [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/CorentinTh/kombi/Node%20CI)](https://github.com/CorentinTh/kombi/actions?query=workflow%3A%22Node+CI%22) \n  [![codecov](https://codecov.io/gh/CorentinTh/kombi/branch/main/graph/badge.svg?token=ESAWKEROML)](https://codecov.io/gh/CorentinTh/kombi)\n  [![npm bundle size](https://img.shields.io/bundlephobia/minzip/kombi.svg)](https://www.npmjs.com/package/kombi) \n  [![GitHub package.json version](https://img.shields.io/github/package-json/v/CorentinTh/kombi.svg)](https://github.com/CorentinTh/kombi/blob/master/package.json) \n  [![Dependencies](https://img.shields.io/badge/dependencies-0-green)](https://www.npmjs.com/package/kombi) \n  [![Licence Badge](https://img.shields.io/github/license/CorentinTh/kombi.svg)](LICENSE)\n    \n\u003c/div\u003e\n\nSimple object and array cartesian combination generator (for node, typescript and the browser). Kombi will generate every combination between the sets of value given as parameters.\n\n## Installation\n### JS / Typescript / Node JS\n**Kombi** can be installed using yarn or npm.\n\n```bash\nnpm install kombi\n# or\nyarn add kombi\n```\n\nAnd import :\n\n```javascript\n// EMAScript import\nimport {kombi} from 'kombi';\n\n// Or Common JS:\nconst {kombi} = require('kombi');\n\n// and used...\n\nconst obj = {\n  a: [1, 2, 3],\n  b: ['a', 'b']\n}\n\nconst mergedObj = kombi(obj)\n\nconsole.log(mergedObj)\n\n/*\n[\n  {a: 1, b: 'a'},\n  {a: 1, b: 'b'},\n  {a: 2, b: 'a'},\n  {a: 2, b: 'b'},\n  {a: 3, b: 'a'},\n  {a: 3, b: 'b'},\n]\n*/\n```\n### Browser\n\nYou can use the CDN:\n```html\n\u003cscript src=\"https://unpkg.com/kombi\"\u003e\u003c/script\u003e\n```\nAnd everything is globally accessible and **prefixed with `Kombi`**:\n```javascript\nconst kombi = new Kombi.kombi(obj)\n```\n\n## Usage\n### Combinate object with array properties\n\n```javascript\nconst result = kombi({\n    a: [1, 2, 3, 4],\n    b: ['a', 'b', 'c', 'd'],\n})\n\n/*\nresult = [\n    {a: 1, b: 'a'}, {a: 1, b: 'b'}, {a: 1, b: 'c'}, {a: 1, b: 'd'},\n    {a: 2, b: 'a'}, {a: 2, b: 'b'}, {a: 2, b: 'c'}, {a: 2, b: 'd'},\n    {a: 3, b: 'a'}, {a: 3, b: 'b'}, {a: 3, b: 'c'}, {a: 3, b: 'd'},\n    {a: 4, b: 'a'}, {a: 4, b: 'b'}, {a: 4, b: 'c'}, {a: 4, b: 'd'}\n]\n*/\n```\n\n### Combinate array of arrays\n\n```javascript\nconst result = kombi([\n    [1, 2, 3, 4],\n    ['a', 'b', 'c'],\n])\n\n/*\nresult = [\n  [1, 'a'], [1, 'b'], [1, 'c'], \n  [2, 'a'], [2, 'b'], [2, 'c'], \n  [3, 'a'], [3, 'b'], [3, 'c'], \n  [4, 'a'], [4, 'b'], [4, 'c']\n]\n*/\n```\n## Roadmap\n* Improve documentation\n* Add more unit test\n* Allow single parameters as input, like :\n```javascript\nconst result = kombi({\n    a: [1, 2, 3, 4],\n    b: ['a', 'b', 'c', 'd'],\n    c: 'foo'\n})\n```\n* Create benchmark\n## Contribute\n**Pull requests are welcome !** Feel free to contribute.\n\n## Credits\nCoded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).\n\n## License\n\nThis project is under the [MIT license](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fkombi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorentinth%2Fkombi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fkombi/lists"}