Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 944 Bytes

File metadata and controls

44 lines (27 loc) · 944 Bytes

aws-feature-toggle

Tag based feature toggle

This works by polling your EC2 instance tag and maintaining an internal cache, so that you can query it to understand if a feature toggle should be enabled.

You have to specify a comma separated list of features that you want to be enabled as value of a tag called feature-toggle.

Installation

npm install aws-feature-toggle

Usage

You start it wherever you app starts passing the instance-id, like so

var ft = require('aws-feature-toggle');

ft.start('i-h725');

You can override the 1 minute poll interval by passing a millisecond value as second parameter to start, like so

var ft = require('aws-feature-toggle');

ft.start('i-h725', 120000);

You can then ask if a certain feature is enabled, like so

var ft = require('aws-feature-toggle');

ft.isFeatureEnabled('your-feature'); // boolean

Running tests

npm test