One Dionys (Feature Toggle Utilities) - Functions to enable or disable features in the application based on certain conditions or parameters.
npm install onedionys-feature-toggle-utilitiesFunctions to enable or disable features in the application based on certain conditions or parameters. 💖
Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
Internet - Because many use CDN and to make it easier to find solutions to all problems.
javascript
const FeatureToggle = require('./src/featureToggle');
const features = {
featureA: true,
featureB: false
};
const featureToggle = new FeatureToggle(features);
console.log(featureToggle.isEnabled('featureA')); // Output: true
console.log(featureToggle.isEnabled('featureB')); // Output: false
console.log(featureToggle.isEnabled('featureC')); // Output: false
`
#### Explanation
* This package provides utilities for feature toggling in applications. The FeatureToggle class takes a map of feature names and their corresponding states (true for enabled, false for disabled). You can then use the isEnabled() method to check if a specific feature is enabled or not.
#### Return Value
* isEnabled(featureName)`: Returns a boolean indicating whether the specified feature is enabled or not.