{"id":19732180,"url":"https://github.com/lifeomic/gradual-feature-toggle-tools","last_synced_at":"2025-04-30T02:31:50.526Z","repository":{"id":33973338,"uuid":"162457590","full_name":"lifeomic/gradual-feature-toggle-tools","owner":"lifeomic","description":"Provides a set of helper functions to make gradual, non-binary, feature toggle use easier","archived":false,"fork":false,"pushed_at":"2024-11-20T09:01:04.000Z","size":920,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-22T15:55:30.651Z","etag":null,"topics":["feature-toggle","team-infra"],"latest_commit_sha":null,"homepage":null,"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/lifeomic.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":"2018-12-19T15:38:09.000Z","updated_at":"2024-11-20T09:01:07.000Z","dependencies_parsed_at":"2024-06-18T08:26:05.452Z","dependency_job_id":null,"html_url":"https://github.com/lifeomic/gradual-feature-toggle-tools","commit_stats":{"total_commits":45,"total_committers":6,"mean_commits":7.5,"dds":0.5111111111111111,"last_synced_commit":"a57aa1ee4cbdcd6a78202eda9210d7678e43c271"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Fgradual-feature-toggle-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Fgradual-feature-toggle-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Fgradual-feature-toggle-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeomic%2Fgradual-feature-toggle-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifeomic","download_url":"https://codeload.github.com/lifeomic/gradual-feature-toggle-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251629177,"owners_count":21618114,"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-toggle","team-infra"],"created_at":"2024-11-12T00:25:11.354Z","updated_at":"2025-04-30T02:31:50.182Z","avatar_url":"https://github.com/lifeomic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradual-feature-toggle-tools\n\n[![npm](https://img.shields.io/npm/v/@lifeomic/gradual-feature-toggle-tools.svg)](https://www.npmjs.com/package/@lifeomic/gradual-feature-toggle-tools)\n[![Build Status](https://travis-ci.org/lifeomic/gradual-feature-toggle-tools.svg?branch=master)](https://travis-ci.org/lifeomic/gradual-feature-toggle-tools)\n[![Greenkeeper badge](https://badges.greenkeeper.io/lifeomic/gradual-feature-toggle-tools.svg)](https://greenkeeper.io/)\n\nA set of tools to make gradual rollout of features easier. For a real world story of how this can be used, checkout https://medium.com/lifeomic/changing-production-databases-with-confidence-and-without-downtime-c5f5d60061d7\n\n## Selecting users to get a feature\n\nWhen a new feature is being rolled out and is currently 50% enabled, then\nideally 50% of the users would get the new behavior. The enablement of the new\nbehavior should be uniform as the feature value is increased and should not be\nbiased by the usernames or feature names. For example, if you use e-mail\naddresses then ideally the enablement of `@gmail.com` users would be evenly\nspread across the range of enablement. The testcases assert that uniform\ndistribution is true.\n\nGiven a feature an a user, this code can help you decide whether a user should\nreceive the new behavior or not:\n\n```js\nimport { calculateUserEnablementThreshold } from 'gradual-feature-toggle-tools';\n\nconst featureValue = // some lookup of a feature's current value (from 0 - 100)\nconst userThreshold = await calculateUserEnablementThreshold('some-feature', 'some-user');\nif (featureValue \u003e userThredshold) {\n    // Use the new behavior\n} else {\n    // Use the old behavior\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeomic%2Fgradual-feature-toggle-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifeomic%2Fgradual-feature-toggle-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeomic%2Fgradual-feature-toggle-tools/lists"}