# bivio

> Bivio is a [feature toggle](https://en.wikipedia.org/wiki/Feature_toggle) library to be used ideally with Typescript. Powered by the Metadata Reflection API, it can be used to turn on/off your app components based on a predicate.

Latest version **0.3.2** (published 2017-04-20) · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2017-04-20 |
| First published | 2016-11-04 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tierratelematics |

## Links

- npm: https://www.npmjs.com/package/bivio
- npm.io page: https://npm.io/package/bivio

## Dependencies (5)

- [envify](https://npm.io/package/envify.md) ~4.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.16.6
- [@types/node](https://npm.io/package/@types/node.md) ^6.0.52
- [@types/lodash](https://npm.io/package/@types/lodash.md) 4.14.43
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.1.8

## Recent versions

- 0.3.2 (latest) — 2017-04-20
- 0.3.1 — 2017-04-20
- 0.3.0 — 2017-03-28
- 0.2.1 — 2017-03-27
- 0.2.0 — 2016-12-20
- 0.1.1 — 2016-11-07
- 0.1.0 — 2016-11-04

## README

# bivio

Bivio is a [feature toggle](https://en.wikipedia.org/wiki/Feature_toggle) library to be used ideally with Typescript. 
Powered by the Metadata Reflection API, it can be used to turn on/off your app components based on a predicate.

## Installation

`
$ npm install bivio
`

## Usage

Decorate the component you want to turn on/off with a predicate.

```typescript
import {Predicates, FeatureToggle} from "bivio"

@FeatureToggle(Predicates.version("2.0.0"))
class MyModule {
    
}
```

Check if the predicate is valid when registering your component.

```typescript

import {FeatureChecker} from "bivio";

let featureChecker = new FeatureChecker();
if (this.featureChecker.check(MyModule)) {
    //Class is valid, turn it on
} else {
    //Class is not valid, turn if off
}
```

### Predicates

[Here](https://github.com/tierratelematics/bivio/blob/develop/scripts/Predicates.ts) you can find all the predicates available, or you can write your own (it's just a function that returns a boolean).

## License

Copyright 2016 Tierra SpA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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