# feature-flag-util

> Feature flag utils to handle whitelist or percentage

Latest version **1.0.5** (published 2022-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install feature-flag-util
pnpm add feature-flag-util
yarn add feature-flag-util
bun add feature-flag-util
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-06-28 |
| First published | 2022-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lucasliet |
| Maintainers | lucasliet |
| Keywords | feature-flag, feature, flag |

## Links

- npm: https://www.npmjs.com/package/feature-flag-util
- Repository: https://github.com/lucasliet/feature-flag-utils
- Homepage: https://github.com/lucasliet/feature-flag-utils#readme
- Issues: https://github.com/lucasliet/feature-flag-utils/issues
- npm.io page: https://npm.io/package/feature-flag-util

## Recent versions

- 1.0.5 (latest) — 2022-06-28
- 1.0.4 — 2022-06-26
- 1.0.3 — 2022-06-25
- 1.0.1 — 2022-06-25
- 1.0.0 — 2022-06-25

## README

# Feature Flag Util
Utilities functions to deal with feature flags.

## installation
```SH
yarn add feature-flag-util
```

## usage

```TS
import * as FeatureFlag from 'feature-flag-util';

const whitelistedCompanies = ['012345678910234', '432019876543210'];

FeatureFlag.isCompanyListed(whitelistedCompanies, '012345678910234'); // returns true

FeatureFlag.isCompanyListed(whitelistedCompanies, '654321043201987'); // returns false

FeatureFlag.isCompanyListedAsNumber(whitelistedCompanies, 12345678910234); // returns true

FeatureFlag.isRandomInPercentage(50); // returns true if random number generated is less than 50 otherwise, false
```

> ℹ for JavaScript <= es5 use require
```JS
var FeatureFlag = require('feature-flag-util');
var result = FeatureFlag.isRandomInPercentage(50);
```

---
_Source: https://npm.io/package/feature-flag-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
