Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

albuquerque

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

albuquerque

Simple A/B view testing for Express.js

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Albuquerque

A simple, A/B testing framework for Express.js. ABQ is middleware that sits between your users and the Express.js rendering engine and doesn’t require you to change any of your existing code.

ABQ randomly assigns a user to either Set A or Set B and automatically swaps out any view with an available A/B view, falling back to the default view if an A/B view does not exist.

You can use this to test the effectiveness of one view to another.

Installation

  npm install albuquerque --save

Usage

ABQ is Express.js middleware and can be setup really simply.

var abq = require('albuquerque');
app.use(abq());

Templates

ABQ overrides the express rendering engine and looks for your A/B views in {view path}/_a/ and {view path}/_b/. You can override this by passing in your own roots paths.

app.use(abq({ viewRootA: 'test-views/a', viewRootB: 'test-views/b' }));

Session

ABQ randomly assigns a user to either the A or B set and uses session state to store the assignment. Make sure you initialize ABQ after your session provider.

var abq = require('albuquerque');

app.use(session({ secret: 'hiesenberg' }));
app.use(abq());

In your own code, you can always find out what set the user is in.


if(req.session.albuquerque.set === 'A'){
    console.log('This user is an A!');
}

Release History

  • 0.1.0 Initial release

Keywords

FAQs

Package last updated on 21 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc