{"id":27079239,"url":"https://github.com/repeale/key-value-replacer","last_synced_at":"2025-08-01T01:05:20.495Z","repository":{"id":103595705,"uuid":"429933303","full_name":"repeale/key-value-replacer","owner":"repeale","description":"key-value-replacer","archived":false,"fork":false,"pushed_at":"2021-12-20T20:41:24.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T01:07:23.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/repeale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-11-19T21:02:29.000Z","updated_at":"2021-12-20T20:41:27.000Z","dependencies_parsed_at":"2023-05-09T15:23:50.069Z","dependency_job_id":null,"html_url":"https://github.com/repeale/key-value-replacer","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"637eb7d405996bfa8e12e5d2a62f6ad42c391372"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"repeale/ts-lib-starter","purl":"pkg:github/repeale/key-value-replacer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repeale%2Fkey-value-replacer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repeale%2Fkey-value-replacer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repeale%2Fkey-value-replacer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repeale%2Fkey-value-replacer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/repeale","download_url":"https://codeload.github.com/repeale/key-value-replacer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/repeale%2Fkey-value-replacer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268151826,"owners_count":24204034,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-04-06T01:33:07.066Z","updated_at":"2025-08-01T01:05:20.432Z","avatar_url":"https://github.com/repeale.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# key-value-replacer\n\n- This is useful when you have values you have to repeat in an Object and you want to keep a single reference in it\n\n## Getting started\n\n```sh\nnpm install --save-dev @repeale/key-value-replacer\n```\n\nor\n\n```sh\nyarn add --dev @repeale/key-value-replacer\n```\n\n## Features\n\n- Replaces the key reference with the value\n- Familiar template literals variables syntax\n- Reference any key with dot notation, like accessing any JS Object prop\n- Multiple keys reference replacement in the same string\n- Support referencing keys along with text\n\n## Usage\n\n```javascript\nimport {replacer} from '@repeale/key-value-replacer'\n\nconst replaced = replacer({\n  me: {\n    name: 'John',\n    lastName: 'Doe',\n  },\n  greetings: \"Hello i'm ${me.name} ${me.lastName}!\",\n})\n```\n\n## Examples\n\n- i18n:\n\n```javascript\n{\n  me: {\n    name: \"John\",\n    lastName: \"Doe\"\n  },\n  greetings: \"Hello i'm ${me.name} ${me.lastName}!\", // -\u003e \"Hello i'm John Doe!\"\n  ...\n}\n```\n\n- CSS design tokens and themes:\n\n```javascript\n{\n  tokens: {\n    accent: {\n      primary: {\n        regular: '#ff6600',\n        light: '#ffaa00',\n        ...\n      },\n      ...\n    },\n    ...\n  }\n  buttons: {\n    primary: {\n      background: {\n        default: '${tokens.accent.primary.regular}' // -\u003e \"#ff6600\"\n        hover: '${tokens.accent.primary.light}', // -\u003e \"#ffaa00\"\n        ...\n      },\n      ...\n    },\n    ...\n  },\n  menu: {\n    link: {\n      color: {\n        default: '${tokens.accent.primary.regular}' // -\u003e \"#ff6600\"\n        hover: '${tokens.accent.primary.light}', // -\u003e \"#ffaa00\"\n        ...\n      },\n      ...\n    },\n    ...\n  },\n  ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepeale%2Fkey-value-replacer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frepeale%2Fkey-value-replacer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frepeale%2Fkey-value-replacer/lists"}