aws-feature-toggle

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i aws-feature-toggle

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • b2mdevelopment