# feature-flag-decorator

> A simple decorator that will only execute the wrapped method if the given feature flag is set. (e.g.: `@FeatureFlag('DEBUG_COLLISIONS')` will only let a method execute if `process.env.DEBUG_COLLISIONS` has been set to a truthy value)

Latest version **0.1.0** (published 2021-08-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-08-08 |
| First published | 2021-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrea Cappuccio |
| Maintainers | 0xcap |

## Links

- npm: https://www.npmjs.com/package/feature-flag-decorator
- npm.io page: https://npm.io/package/feature-flag-decorator

## Recent versions

- 0.1.0 (latest) — 2021-08-08

## README

# feature-flag-decorator

A simple decorator that will only execute the wrapped method if the given feature flag is set.
(e.g.: `@FeatureFlag('DEBUG_COLLISIONS')` will only let a method execute if `process.env.DEBUG_COLLISIONS` has been set to a truthy value)

---

#### Installation

`yarn add feature-flag-decorator`
or
`npm install feature-flag-decorator`

---

#### Usage example

```typescript
import FeatureFlag from 'feature-flag-decorator';

class MyClass {
  @FeatureFlag('DEBUG_COLLISIONS')
  debugMyCollisions(): void {
    console.log("Hey, I'm debugging some collisions here!");
  }
}
```

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