0.1.0 • Published 12 years ago

abie v0.1.0

Weekly downloads
11
License
-
Repository
github
Last release
12 years ago

Abie = A/B-testing in node

Installation

$ npm install abie

Usage

Configure a test

    abie.addTest({
      name : "mytest",    //Refer to this when running the test
      population : 10000, //Amount of impressions
      variations : [
        { "name" : "coolVariation", weight : "0.5", default : true }, //When test is over, the code will revert to default variation
        { "name" : "notSoCoolVariation", weight : "0.5" },
      ]
    })

In a template

    if abie('mytest', 'coolVariation')
      h1 CoolVariation-header
    if abie('mytest', 'notSoCoolVariation')
      h1 Not so cool, but effective? Who knows, that's the fun!

In a template

    if abie('mytest', 'coolVariation')
      res.render('variationA')
    if abie('mytest', 'notSoCoolVariation')
      res.render('variationA')