{"id":17962793,"url":"https://github.com/fgribreau/json-combine","last_synced_at":"2026-02-27T08:42:28.419Z","repository":{"id":66110066,"uuid":"107326225","full_name":"FGRibreau/json-combine","owner":"FGRibreau","description":"Generate every possible combination of values","archived":false,"fork":false,"pushed_at":"2023-01-12T08:23:42.000Z","size":127,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T21:10:40.700Z","etag":null,"topics":["combinations","json"],"latest_commit_sha":null,"homepage":"https://twitter.com/FGRibreau","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/FGRibreau.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-17T21:30:55.000Z","updated_at":"2023-10-08T21:29:17.000Z","dependencies_parsed_at":"2023-02-23T18:16:20.879Z","dependency_job_id":null,"html_url":"https://github.com/FGRibreau/json-combine","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FGRibreau/json-combine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fjson-combine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fjson-combine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fjson-combine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fjson-combine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FGRibreau","download_url":"https://codeload.github.com/FGRibreau/json-combine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGRibreau%2Fjson-combine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T08:34:21.514Z","status":"ssl_error","status_checked_at":"2026-02-27T08:32:38.035Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["combinations","json"],"created_at":"2024-10-29T11:20:42.587Z","updated_at":"2026-02-27T08:42:28.405Z","avatar_url":"https://github.com/FGRibreau.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-combine\n\n### Generate every possible combination of values\n\n[![Build Status](https://img.shields.io/circleci/project/FGRibreau/json-combine.svg)](https://circleci.com/gh/FGRibreau/json-combine/) [![Coverage Status](https://img.shields.io/coveralls/FGRibreau/json-combine/master.svg)](https://coveralls.io/github/FGRibreau/json-combine?branch=master) [![Deps](\thttps://img.shields.io/david/FGRibreau/json-combine.svg)](https://david-dm.org/FGRibreau/json-combine) [![NPM version](https://img.shields.io/npm/v/json-combine.svg)](http://badge.fury.io/js/json-combine) \n\n\u003c!--[![Downloads](http://img.shields.io/npm/dm/json-combine.svg)](https://www.npmjs.com/package/json-combine) --\u003e\n\n[![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/francois-guillaume-ribreau?utm_source=github\u0026utm_medium=button\u0026utm_term=francois-guillaume-ribreau\u0026utm_campaign=github)  [![available-for-advisory](https://img.shields.io/badge/available%20for%20advising-yes-ff69b4.svg?)](http://bit.ly/2c7uFJq) ![extra](https://img.shields.io/badge/actively%20maintained-yes-ff69b4.svg?) [![Slack](https://img.shields.io/badge/Slack-Join%20our%20tech%20community-17202A?logo=slack)](https://join.slack.com/t/fgribreau/shared_invite/zt-edpjwt2t-Zh39mDUMNQ0QOr9qOj~jrg)\n\n\n## npm\n\n```\nnpm install json-combine --save\n```\n\n## usage\n\n```js\nconst {flatten, combine} = require('json-combine');\n\n// mutation to apply\nconst mutations = [\n  {\n    key: 'a.b.c',\n    values:[true, false]\n  },\n  {\n    key: 'a.b.d.e',\n    values:[1, 2, 3]\n  },\n];\n\n// base object\nconst template = {\n  a:{\n    b:{\n      c: false,\n      d:{\n        e: 0\n      }\n    }\n  }\n};\n\nconsole.log(combine(flatten(mutations), template));\n```\n\nOutputs an array of every possible combinations :\n\n```js\n[\n {\n   \"a\": {\n     \"b\": {\n       \"c\": true,\n       \"d\": {\n         \"e\": 1\n       }\n     }\n   }\n },\n {\n   \"a\": {\n     \"b\": {\n       \"c\": true,\n       \"d\": {\n         \"e\": 2\n       }\n     }\n   }\n },\n {\n   \"a\": {\n     \"b\": {\n       \"c\": true,\n       \"d\": {\n         \"e\": 3\n       }\n     }\n   }\n },\n {\n   \"a\": {\n     \"b\": {\n       \"c\": false,\n       \"d\": {\n         \"e\": 1\n       }\n     }\n   }\n },\n {\n   \"a\": {\n     \"b\": {\n       \"c\": false,\n       \"d\": {\n         \"e\": 2\n       }\n     }\n   }\n },\n {\n   \"a\": {\n     \"b\": {\n       \"c\": false,\n       \"d\": {\n         \"e\": 3\n       }\n     }\n   }\n }\n]\n```\n\n\n## test\n\n```\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgribreau%2Fjson-combine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgribreau%2Fjson-combine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgribreau%2Fjson-combine/lists"}