# stanza-ab

> Stanza AB testing library

Latest version **0.0.8** (published 2021-07-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install stanza-ab
pnpm add stanza-ab
yarn add stanza-ab
bun add stanza-ab
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2021-07-15 |
| First published | 2017-04-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 <16.0.0 |
| Dependencies | 1 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | matt@stanza.co |
| Maintainers | mattatstanza |

## Links

- npm: https://www.npmjs.com/package/stanza-ab
- Repository: https://github.com/joinspoton/stab
- Homepage: https://github.com/joinspoton/stab#readme
- Issues: https://github.com/joinspoton/stab/issues
- npm.io page: https://npm.io/package/stanza-ab

## Dependencies (1)

- [write-file-webpack-plugin](https://npm.io/package/write-file-webpack-plugin.md) ^4.0.0

## Recent versions

- 0.0.8 (latest) — 2021-07-15
- 0.0.7 — 2020-06-17
- 0.0.6 — 2020-06-16
- 0.0.5 — 2017-09-08
- 0.0.4 — 2017-05-16
- 0.0.3 — 2017-05-05
- 0.0.2 — 2017-04-07
- 0.0.1 — 2017-04-07

## README

# Stab
*STanza A-B testing*

# Test Configuration
`Stab` expects an object specifying which tests to run, and which percentage of users should be in each group. Most ofen, you'll want to just test with two groups per test.


```javascript
type ABConfig = {
    [testName: string]: Array<Number>
};
```

Eg:

```javascript
const config = {
    homepageText: [4, 1], // 4/5ths of users in group A, 1/5th of users in group B
    addButton: [1, 1], // 50/50
    landingPage: [1, 2, 1, 1] // 20% 40% 20% 20% split
};
```

```javascript
Stab.configure(config: ABConfig)
```

```javascript
Stab.groupA(testName: string): boolean
Stab.groupB(testName: string): boolean
```


```javascript
Stab.groupNum(testName: string): number
```

```javascript
Stab.getGroups(): [key: string]: string
```

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