freeze-flip

0.0.1 • Public • Published

Freeze

Freeze is a pretty simple, yet powerful feature flipper, powered by Redis.

Usage

var Freeze = require('freeze-flip');
var freeze = new Freeze({ host: '127.0.0.1', port: 6379 });
 
freeze.enable('feature_name').then(...);
freeze.disable('feature_name').then(...);
 
feature.isEnabled('feature_name').then(function(enabled) 
{
  if (enabled) {
    // Feature is enabled.
  } else {
    // Do something else.
  }
});

Defining Features

Because Redis is not persistent, and for this usecase, should not. We need a way to easily define these features and re-allocate them. This allows you to re-define the features whenever your application launches, or whenever you deploy. It only creates entries that do not currently exist. By default, newly defined features will be disabled.

freeze.define('feature_name');

Express App

This module comes with an express app to help you manage the features. It comes with the ability to list all the features, and their status (enabled, disabled), and allows you to flip it.

var Freeze = require('freeze-flip');
 
// Create a new server;
Freeze.createApp(freezeInstance)
  .listen(4000);

The createApp method returns an express application.

License

MIT

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i freeze-flip

    Weekly Downloads

    2

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • thehydroimpulse