Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flipper

Package Overview
Dependencies
Maintainers
1
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flipper

Feature Flipping for node.js

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
62
decreased by-10.14%
Maintainers
1
Weekly downloads
 
Created
Source

Flipper - feature flipping for node.js

Feature flipping (also called feature toggling) is a technique used in Continuous Deployment to allow developers to work on new features without blocking releases to production. 99 Designs explain it well.

There's also another implementation of feature flipping for node.js.

API

Defining a feature

var flipper = require('flipper');
flipper.add('mutatedDolphins');

Testing for a feature

var flipper = require('flipper');
if (flipper.mutatedDolphins) {
  /* dolphins are now mutated */
} else {
  /* normal dolphins */
}
/* alternatively */
flipper.isEnabled('mutatedDolphins')

Enabling a feature

flipper.mutatedDolphins = true;
flipper.enable('mutatedDolphins');

Disabling a feature

flipper.mutatedDolphins = false;
flipper.disable('mutatedDolphins');

Finding out all current features

flipper.allFeatures() /* returns array of { "feature name": status } */

Connect middleware

If you make use of the connect middleware:

var app = connect().use(flipper.http('/flipper')).listen(3000);

You can flip and inspect features via HTTP:

curl http://localhost:3000/flipper/ # returns all features with status (true/false)
curl http://localhost:3000/flipper/mutatedDolphins # returns status (true/false)
curl -X PUT http://localhost:3000/flipper/mutatedDolphins --data-binary true #enables the feature
curl -X PUT http://localhost:3000/flipper/mutatedDolphins --data-binary false

Persistence

To survive application restarts, flipper can write a configuration file whenever a feature is added, enabled, or disabled. To enable this, call the persist function:

var flipper = require('flipper');
flipper.persist(__dirname  + '/features.json');

FAQs

Package last updated on 08 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc