{"id":20014674,"url":"https://github.com/willmendesneto/feature-toggle-service","last_synced_at":"2025-10-04T13:44:39.883Z","repository":{"id":21279746,"uuid":"92065086","full_name":"willmendesneto/feature-toggle-service","owner":"willmendesneto","description":"The simplest solution for feature toggle in Javascript. Simple how it should be.","archived":false,"fork":false,"pushed_at":"2025-03-29T21:26:35.000Z","size":2259,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T04:52:24.968Z","etag":null,"topics":["feature-flag","feature-toggle","feature-toggle-service","hacktoberfest","toggle"],"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/willmendesneto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-22T14:48:55.000Z","updated_at":"2025-02-26T01:21:02.000Z","dependencies_parsed_at":"2024-06-19T02:45:59.887Z","dependency_job_id":"abd07222-d1df-49ca-9671-98e34616e8b9","html_url":"https://github.com/willmendesneto/feature-toggle-service","commit_stats":{"total_commits":92,"total_committers":4,"mean_commits":23.0,"dds":0.3804347826086957,"last_synced_commit":"5aab28b00e2e299fcc16b6b02c9f5652695d0941"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willmendesneto%2Ffeature-toggle-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willmendesneto%2Ffeature-toggle-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willmendesneto%2Ffeature-toggle-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willmendesneto%2Ffeature-toggle-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willmendesneto","download_url":"https://codeload.github.com/willmendesneto/feature-toggle-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252408106,"owners_count":21743054,"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-toggle","feature-toggle-service","hacktoberfest","toggle"],"created_at":"2024-11-13T07:43:25.227Z","updated_at":"2025-10-04T13:44:34.569Z","avatar_url":"https://github.com/willmendesneto.png","language":"TypeScript","readme":"# Feature Toggle Service\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/willmendesneto/feature-toggle-service.svg)](https://greenkeeper.io/)\n[![npm](https://img.shields.io/badge/stackblitz-online-orange.svg)](https://stackblitz.com/edit/feature-toggle-service-playground)\n\n[![npm version](https://badge.fury.io/js/feature-toggle-service.svg)](http://badge.fury.io/js/feature-toggle-service) [![npm downloads](https://img.shields.io/npm/dm/feature-toggle-service.svg)](https://npmjs.org/feature-toggle-service)\n[![MIT License](https://img.shields.io/badge/license-MIT%20License-blue.svg?style=flat-square)](LICENSE)\n\n[![Build Status](https://circleci.com/gh/willmendesneto/feature-toggle-service.svg?style=shield)](https://circleci.com/gh/willmendesneto/feature-toggle-service)\n[![Coverage Status](https://coveralls.io/repos/willmendesneto/feature-toggle-service/badge.svg?branch=master)](https://coveralls.io/r/willmendesneto/feature-toggle-service?branch=master)\n[![Dependency Status](https://david-dm.org/willmendesneto/feature-toggle-service.svg)](https://david-dm.org/willmendesneto/feature-toggle-service)\n\n[![NPM](https://nodei.co/npm/feature-toggle-service.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://npmjs.org/feature-toggle-service)\n[![NPM](https://nodei.co/npm-dl/feature-toggle-service.png?height=3\u0026months=3)](https://npmjs.org/feature-toggle-service)\n\nThe simplest solution for [feature toggles](http://martinfowler.com/bliki/FeatureToggle.html) in Javascript. Simple how it should be.\n\n## Why Feature toggle?\n\n\u003e This is a common concept, but why use this directive instead solve it via server-side rendering?\n\nThe idea of this directive is make this process transparent and easier. So the main point is integrate this directive with other tooling process, such as:\n\n- Server-side rendering;\n- Progressive rendering;\n- Any other that yoy like :)\n\nYou can integrate with WebSockets or handling this in a EventSourcing architecture. It's totally transparent for you and you can integrate easier in your application.\n\n## Contributing\n\nPlease check our [contributing.md](https://github.com/willmendesneto/feature-toggle-service/blob/master/contributing.md) to know more about setup and how to contribute.\n\n## Setup and installation\n\nMake sure that you are using the NodeJS version is the same as `.nvmrc` file version. If you don't have this version please use a version manager such as `nvm` or `n` to manage your local nodejs versions.\n\n\u003e Please make sure that you are using NodeJS version 6.10.2\n\nAssuming that you are using `nvm`, please run the commands inside this folder:\n\n```bash\n$ nvm install $(cat .nvmrc); # install required nodejs version\n$ nvm use $(cat .nvmrc); # use nodejs version\n```\n\nIn Windows, please install NodeJS using one of these options:\n\nVia `NVM Windows` package: Dowload via [this link](https://github.com/coreybutler/nvm-windows). After that, run the commands:\n\n```bash\n$ nvm install $(cat .nvmrc); # install required nodejs version\n$ nvm use $(cat .nvmrc); # use nodejs version\n```\n\nVia Chocolatey:\n\n```bash\n$ choco install nodejs.install -version 6.10.2\n```\n\n### Install yarn\n\nWe use `yarn` as our package manager instead of `npm`\n\n[Install it following these steps](https://yarnpkg.com/lang/en/docs/install/#mac-tab)\n\nAfter that, just navigate to your local repository and run\n\n```bash\n$ yarn install\n```\n\n## Demo\n\nTry out our [demo on Stackblitz](https://feature-toggle-service-playground.stackblitz.io)!\n\n### Run the tests\n\n```bash\n$ yarn test # run the tests\n```\n\n### Run the build\n\n```bash\n$ yarn build # run the tests\n```\n\n### Run the bundlesize check\n\n```bash\n$ yarn bundlesize # run the tests\n```\n\n### Run the code lint\n\n```bash\n$ yarn lint # run the tests\n```\n\n## `FeatureToggleService`\n\nThis service exposes a few different methods with which you can interact with feature toggle service.\n\n### `featureToggleService.set(obj)`\n\nAdds the feature toggle configuration in your application. This information will be private and checked via `featureToggleService.isOn(key)` method.\n\n### `featureToggleService.isOn(key, debug)`\n\nChecks if the feature toggle configuration has the string key value with `true` value. For bundle reasons if you want to check if the feature toggle is turned off, please use `!featureToggleService.isOn(key)`. When `debug` param is passed as `true` and it's not `NODE_ENV` is not set to prod, it prints configuration, version and settings for debug purposes\n\n## Publish\n\nthis project is using `np` package to publish, which makes things straightforward. EX: `np \u003cpatch|minor|major\u003e`\n\n\u003e For more details, [please check np package on npmjs.com](https://www.npmjs.com/package/np)\n\n## Author\n\n**Wilson Mendes (willmendesneto)**\n\n- \u003chttps://twitter.com/willmendesneto\u003e\n- \u003chttp://github.com/willmendesneto\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillmendesneto%2Ffeature-toggle-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillmendesneto%2Ffeature-toggle-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillmendesneto%2Ffeature-toggle-service/lists"}