{"id":13739435,"url":"https://github.com/ember-cli/babel-plugin-feature-flags","last_synced_at":"2025-06-24T11:07:13.886Z","repository":{"id":33346650,"uuid":"36991451","full_name":"ember-cli/babel-plugin-feature-flags","owner":"ember-cli","description":"A babel transform for managing feature flags","archived":false,"fork":false,"pushed_at":"2021-07-28T03:32:32.000Z","size":51,"stargazers_count":58,"open_issues_count":6,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-06-14T04:38:44.016Z","etag":null,"topics":["babel-plugin"],"latest_commit_sha":null,"homepage":null,"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/ember-cli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-06T18:53:14.000Z","updated_at":"2025-03-05T01:29:28.000Z","dependencies_parsed_at":"2022-08-17T17:35:18.349Z","dependency_job_id":null,"html_url":"https://github.com/ember-cli/babel-plugin-feature-flags","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ember-cli/babel-plugin-feature-flags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-feature-flags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-feature-flags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-feature-flags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-feature-flags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ember-cli","download_url":"https://codeload.github.com/ember-cli/babel-plugin-feature-flags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fbabel-plugin-feature-flags/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261265198,"owners_count":23132600,"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":["babel-plugin"],"created_at":"2024-08-03T04:00:33.969Z","updated_at":"2025-06-24T11:07:13.858Z","avatar_url":"https://github.com/ember-cli.png","language":"JavaScript","readme":"# babel-plugin-feature-flags\n\n[![Build Status](https://travis-ci.org/ember-cli/babel-plugin-feature-flags.svg?branch=master)](https://travis-ci.org/ember-cli/babel-plugin-feature-flags)\n\n*This plugin is for Babel 6. If you need to support Babel 5 use the 0.2.x releases.*\n\nA babel plugin that implements feature flags for enabling and disabling features. This plugin is intended to be followed by a dead code elimination pass (Uglify, babel-plugin-dead-code-elimination, etc.) to remove any unreachable code.\n\nFeature flags are implemented by looking for call expressions like `isEnabled('my-feature')` and checking if the feature is enabled/disabled/disabled in a feature map that is passed through the plugin options. If the feature is known to be enabled or disabled then the call expression is replace with a boolean literal (`true` or `false` respectively). If the feature is dynamic, than the call expression is left alone.\n\n## Example\n\nGiven the `.babelrc`\n\n```json\n{\n  \"plugins\": [[\"feature-flags\", {\n    \"import\": {\n        \"module\": \"my-features\"\n    },\n    \"features\": {\n        \"new-feature\": \"disabled\"\n    }\n  }]]\n}\n```\n\nthe JavaScript file\n\n```js\nimport isEnabled from 'my-features';\n\nif (isEnabled('new-feature')) {\n  // code\n}\n```\n\nwill be transformed to\n\n```js\nimport isEnabled from 'my-features';\n\nif (false) {\n  // code\n}\n```\n\n## Configuration\n\nHere are the options that you can pass to the babel plugin.\n\n- `options.import.module` [`String`]: The name of the module that the feature function is imported from.\n- `options.import.name` [`String` (Optional)]: The name of the export that the feature function is imported from. Defaults to `\"default\"`.\n- `options.features` [`Map(String -\u003e 'enabled' | 'disabled' | 'dynamic')`]: An object whose keys are the names of features and whose values determine whether the feature is enabled/disabled/dynamic.\n","funding_links":[],"categories":["Plugins"],"sub_categories":["General Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-cli%2Fbabel-plugin-feature-flags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fember-cli%2Fbabel-plugin-feature-flags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fember-cli%2Fbabel-plugin-feature-flags/lists"}