# fflags

> Feature flags npm package (browser and nodejs) with TypeScript support

Latest version **2.0.1** (published 2022-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install fflags
pnpm add fflags
yarn add fflags
bun add fflags
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-02-04 |
| First published | 2022-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | kliuiev-io |
| Maintainers | kliuiev-io |
| Keywords | feature, flags, node.js, browser, client, typescript |

## Links

- npm: https://www.npmjs.com/package/fflags
- Repository: https://github.com/kliuiev-io/FeatureFlags
- Homepage: https://github.com/kliuiev-io/FeatureFlags#readme
- Issues: https://github.com/kliuiev-io/FeatureFlags/issues
- npm.io page: https://npm.io/package/fflags

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-02-04
- 2.0.0 — 2022-02-04
- 1.0.1 — 2022-01-27
- 1.0.0 — 2022-01-27

## README

# Feature Flags

## Installation

### To use in browser

```
npm i fflags
```

```
yarn add fflags
```

### To use with node.js

```
npm i fflags node-fetch@2
```

```
yarn add fflags node-fetch@2
```

## Usage

```js
const { FeatureFlags } = require('fflags'); // Node.js CommonJS
import { FeatureFlags } from 'fflags'; // TypeScript ESModule

const SERVER_URL = 'https://yourserver.com';
const INSTANCE_NAME = 'instance-name';
const USER_EMAIL = 'test@example.com';

const flagStorage = new FeatureFlags(`${SERVER_URL}/client/${INSTANCE_NAME}/${USER_EMAIL}`);

async function main() {
  await flagsStorage.initialize(); // Fetch flags for specified instance and email

  console.log(flagsStorage.checkFlag('flag-name')); // true/false
  console.log(flagsStorage.flags); // [...]
}

main();
```

## Other parts of Feature Flags

- [Server](https://github.com/kliuiev-io/feature-flags/tree/master/server)
- [Admin dashboard](https://github.com/kliuiev-io/feature-flags/tree/master/client)

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