{"id":17617331,"url":"https://github.com/viral98/feature-flags","last_synced_at":"2025-03-30T00:41:16.649Z","repository":{"id":57380716,"uuid":"459256020","full_name":"viral98/feature-flags","owner":"viral98","description":"We use this system to define features that we can easily turn on and off, for testing or to put something temporarily on hold.","archived":false,"fork":false,"pushed_at":"2022-02-22T00:41:43.000Z","size":3518,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T15:11:52.255Z","etag":null,"topics":["feature-flag","feature-flags","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/viral98.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":"2022-02-14T17:19:18.000Z","updated_at":"2022-02-15T19:30:55.000Z","dependencies_parsed_at":"2022-09-19T16:52:53.637Z","dependency_job_id":null,"html_url":"https://github.com/viral98/feature-flags","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/viral98%2Ffeature-flags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral98%2Ffeature-flags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral98%2Ffeature-flags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral98%2Ffeature-flags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viral98","download_url":"https://codeload.github.com/viral98/feature-flags/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262492,"owners_count":20749170,"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":["feature-flag","feature-flags","typescript"],"created_at":"2024-10-22T19:12:30.278Z","updated_at":"2025-03-30T00:41:16.628Z","avatar_url":"https://github.com/viral98.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## FEATURE FLAGS\n \nWe use this system to define features that we can easily turn on and off, for testing or to put something temporarily on hold.\n \nTo define one, add it to the `defaults` object. The value must be a boolean.\n \nUse it in TypeScript code:\n\n```typescript\nimport features from \"ts-feature-flags\";\n\nfunction foo() {\nif (features.enabled(\"bar\")) {\n    doSomething();\n }\n}\n```\n\nUse it in TSX:\n```typescript\n\u003cdiv\u003e\n {features.enabled(\"bar\") \u0026\u0026 \u003cSomething /\u003e}\n\u003c/div\u003e\n```\n\nUse it in JavaScript code:\n```javascript\nimport features from \"ts-feature-flags\";\n\nfunction foo() {\nif (features.bar)) {\n    doSomething();\n }\n}\n```\n\nTo set or unset them, open devtools, and:\n```javascript\nfeatures.foo = true;\nfeatures.bar = false;\nfeatures.unset('piyo'); // resets to default\n```\nThen you have to reload the page or restart the app. Intentionally the values are not changed on the fly, to avoid bugs with IPC, React update headaches, etc.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral98%2Ffeature-flags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviral98%2Ffeature-flags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral98%2Ffeature-flags/lists"}