npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

house-ab

v1.0.4

Published

an a/b testing framework for node

Downloads

12

Readme

House, An A/B Testing Framework for Node

logo-smaller

The House Always Wins

Why?

A/B Testing is great. It makes you lots of money. Everyone likes money.

The mega-geniuses out there make it seem complicated. It doesn't have to be.

What is A/B Testing?

Look at it this way.

Let's say you run a burger joint, Bill's Burgers.

You and your co-owner, have a disagreement, over the name of the burger special, "Super Bagel Burger." She thinks it would sell better if it was called the "Ultra Bagel Burger."

This point is bitterly debated for many long years. Finally, you have an idea.

Half the customers who come in will be offered the "Super Bagel Burger." The other half will be offered the "Ultra Bagel Burger."

You tally up the exact number of burgers each customer group buys. After 1,000 customers, you see that 352/500 have bought Super Bagel Burgers, and 256/500 have bought Ultra Bagel Burgers. You now know the Super Bagel Burger does sell better (37.5% better!), and you can prove it.

A/B testing when applied to web-based enterprises works basically the same way.

Example Usage

In order to use this module, you have to import the house module and create a new ab test, then set that test up as a route in Express. Here's a working example...

let express = require('express');
let house = require('house-ab');

let app = new express();
let ab = new house.ab();
let port = process.env.PORT || 7777;

ab.option()
	.name(`Group A - elite controller offer page (multiple)`)
	.url(`https://www.amazon.com/gp/offer-listing/B00ZDNNRB8`)
	.probability(1);

ab.option()
	.name(`Group B - elite controller main page`)
	.url(`https://www.amazon.com/dp/B00ZDNNRB8`)
	.probability(1);


app.use('/elite-controller', ab.middleware());
app.get('/',(req,res)=>{
	res.send(
		`
			<a target=_blank href="elite-controller">Do the test</a>;
		`
	)
})

app.listen(port,()=>{console.log(`App listening on port ${port}`)});

What is it?

House.js is basically express Middleware that randomizes the outcome. It's perfect for A/B testing and easy to use. There is support (not yet implemented) for sending additional requests to analytics endpoints.

Running Tests

npm test