Skip to content

Files

Latest commit

24fe2a9 · Jan 4, 2021

History

History
This branch is 1240 commits behind textlint/textlint:master.

feature-flag

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 24, 2020
Jun 10, 2020
Jun 10, 2020
Dec 22, 2020
Nov 27, 2017
Nov 27, 2017
Jan 4, 2021
Aug 30, 2020
Jul 24, 2020

@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";
// core flag
assert.ok(coreFlags.runningCLI === false);
assert.ok(coreFlags.runningTester === false); // default loose
coreFlags.runningCLI = true;
coreFlags.runningTester = true;
coreFlags.experimental = true;
assert.ok(coreFlags.runningCLI === true);
assert.ok(coreFlags.runningTester === true);
assert.ok(coreFlags.experimental === true);
// feature-flag
try{
    isFeatureEnabled("test")
}catch(error){
    // default strict
}
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.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu