@textlint/feature-flag
textlint internal feature flag manager.
Install
Install with npm:
npm install @textlint/feature-flag
Usage
import { coreFlags, isFeatureEnabled, setFeature } from "@textlint/feature-flag";
assert.ok(coreFlags.runningCLI === false);
assert.ok(coreFlags.runningTester === false);
coreFlags.runningCLI = true;
coreFlags.runningTester = true;
coreFlags.experimental = true;
assert.ok(coreFlags.runningCLI === true);
assert.ok(coreFlags.runningTester === true);
assert.ok(coreFlags.experimental === true);
try{
isFeatureEnabled("test")
}catch(error){
}
setFeature("test", true);
assert.ok(isFeatureEnabled("test") === true);
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu