
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
blue-red-testing
Advanced tools
A/B testing made easy. (modified version of ab-testing package by @xavimb)
npm install ab-testing
var ABTesting = require('ab-testing');
var testObject = ABTesting.createTest('firstTest', // This name has to be unique across all the tests
[
{
name: 'A',
weight: 0.1 // If not set, the default value is 0.5
outcome: true // The value returned if the user is in this bucket (can be anything)
},
{
name: 'B',
weight: 0.9
outcome: false
}
]);
// Given a unique ID of the user, returns 'A' or 'B'
var testGroup = testObject.getGroup(user.id);
// Returns the name of the test, in this case 'firstTest'
var testName = testObject.getName();
// Executes the test and returns the outcome for the given user
testObject.test(testGroup, this);
// Use the test name and the group name to track analytics
sendToAnalytics(testName, testGroup);
var ABTesting = require('ab-testing');
var landingPageTest = ABTesting.createTest('landingPage', [{ name: 'oldLandingPage' }, { name: 'newLandingPage' }]);
var pricingPageTest = ABTesting.createTest('pricingPage', [{ name: 'oldPricingPage' }, { name: 'newPricingPage' }]);
...
var landingPageGroup = pandingPageTest.getGroup(req.account.username);
var pricingPageGroup = pricingPageTest.getGroup(req.account.username);
...
landingPageTest.test(landingPageGroup, [
function () {
// oldLandingPage code
},
function () {
// newLandingPage code
}
], this);
pricingPageTest.test(pricingPageGroup, [
function () {
// oldPricingPage code
},
function () {
// newPricingPage code
}
], this);
NB: the last parameter
this
is optional. If the scope is not required, this paremeter can be ignored.
FAQs
A/B testing made easy.
We found that blue-red-testing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.