0.0.1 • Published 5 years ago
@uitheory/flip v0.0.1
Flip
Dead simple feature flag configuration
Installation
npm install --save @uitheory/flip
#or yarn
yarn add @uitheory/flip
Usage
import flip from '@uitheory/flip';
const hasFeature = flip({
features: {
feature1: true,
feature2: false,
feature3: context => context.user.isTester,
feature4: context => context.env === 'staging',
},
context: {
// context about the environment, user, etc.
user: {
isTester: true,
},
env: 'staging',
},
});
if (hasFeature('feature1')) {
console.log('congrats!');
}
0.0.1
5 years ago