feature flipper implementation in nodejs
JavaScript HTML CSS
Latest commit 6b941ed Dec 2, 2015 @bigodines Merges all storage tests into a single test file.
It makes sense to make the same tests running against every storage so that we
make sure they follow the same contract (no interfaces in javascript..
Failed to load latest commit information.
admin api routes on app.js. Should be enough to start playing with it. Mar 8, 2013
node_modules/redis Creates a memcache storage module Nov 29, 2015
storage Storage identification name. Might be handy ;) Dec 2, 2015
.gitignore adding feature-flipper-js to npm, yay. Mar 4, 2012
.travis.yml Creates a memcache storage module Nov 29, 2015
README.textile Update README.textile Mar 8, 2013
package.json Creates a memcache storage module Nov 29, 2015


Repo stability: alpha (mvp complete)

early adopters are always welcome :-)


The goal of this project is to provide an easy yet flexible way to test features only with a subset of your users.

Feature Flippers are becoming more and more popular as companies started implementing Lean Startup and Continuous Deployment techniques in their development process. The reason is very simple: It enables you to control which features will be displayed for your users, allowing tests in production without affecting the whole user set.

We all know that production environments always have some gotchas that we can’t fake in tests or can’t reproduce in staging environments. How cool would be if we could push something disabled to production and enable it just for us, so we can test before enabling to everyone? Feature Flipper is here to the rescue :-)

Proposed workflow

Here is how I use Feature Flipper:

  1. Develop a feature;
  2. Add it to feature flipper;
  3. Enabled it to yourself (it should be ok to use production env as all features are disabled by default);
  4. Test, test, test;
  5. Enable to all users;
  6. After feature is stable, remove the feature that would be rendered instead of the new one.
  7. Clean up your code and get back to 1)

Library usage:

This library is in it very early stage. So far it supports only basic operation but it is under heavily development and I plan to add many more features in the next couple weeks.

Create a feature flipper object passing the storage engine you plan to use and create some features:

var feature_flipper = require('../feature_flipper'),
    ff_redis = require('../storage/ff_redis')();    
/* Create your set of features*/
var ff = feature_flipper(ff_redis);
    ff.save(ff.create_feature({id: 'header', 
                       description: 'Site header', 
                       enabledTo : 'all'}));
    ff.save(ff.create_feature({id: 'new_message_bar_layout', 
                       description: 'Testing the new messagebar layout with some users', 
                       enabledTo : ['johnny', 'mark', 'ron', 'some executive']}));
    ff.save(ff.create_feature({id: 'bugfix #35', 
                       description: 'Attempt to fix bug #35 of some product', 
                       enabledTo : ['qa_user_1', 'tati', 'johnny']}));

Then you’ll have a way to test wether to render this feature or something else:

ff.check('new_message_bar_layout', 'johnny', function(is_enabled) { 
     return is_enabled ? render_feature() : render_something_else();

ff.check('header', 'johnny', function(is_enabled) {
    return is_enabled ? render_feature() : render_something_else();

ff.check('bugfix #35', 'some_user_that_will_not_see_this', function (is_enabled) {
    return is_enabled ? render_feature() : render_something_else();

Delete a feature:

ff.delete('bugfix #35');


This library currently depends on mocha, should and redis modules for nodejs. You can install all of them with npm

The sample_app/ requires express as well.


Please check ‘issues’ for more details on what’s in the roadmap and bugfixes