{"id":12789,"library":"abbajs","title":"ABBA.js A/B Test Analysis","description":"ABBA.js is a JavaScript library designed for statistical analysis relevant to A/B testing, including functions for normal and binomial distributions, and a utility for computing experiment results. It provides methods for density, cumulative distribution function (CDF), survival function, and inverse CDF for both normal and binomial distributions. Additionally, it offers an `Experiment` class to calculate proportion, relative improvement, and p-value for A/B test variations against a baseline. The package is currently at version 0.1.4, published in 2014, and appears to be abandoned, with no significant updates or active maintenance in over 7 years. Its core differentiator lies in offering common statistical distribution functions and A/B test result computation directly in JavaScript, without external dependencies, though its age makes it unsuitable for modern ESM-first environments.","status":"abandoned","version":"0.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/thii/abbajs","tags":["javascript"],"install":[{"cmd":"npm install abbajs","lang":"bash","label":"npm"},{"cmd":"yarn add abbajs","lang":"bash","label":"yarn"},{"cmd":"pnpm add abbajs","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is CommonJS-only and exports a single 'Abba' object containing all distribution and experiment classes. Attempting to use ES module `import` syntax will result in errors in modern Node.js or browser environments without a compatible bundler.","wrong":"import Abba from 'abbajs';\nimport { Abba } from 'abbajs';","symbol":"Abba","correct":"const Abba = require('abbajs');"},{"note":"Individual classes like `NormalDistribution` are properties of the main `Abba` export and must be accessed via `Abba.<ClassName>`. They are constructors, requiring the `new` keyword.","wrong":"import { NormalDistribution } from 'abbajs';\nconst normal = new NormalDistribution(mean, standardDeviation);","symbol":"Abba.NormalDistribution","correct":"const Abba = require('abbajs');\nconst normal = new Abba.NormalDistribution(mean, standardDeviation);"},{"note":"Similar to `NormalDistribution`, `Experiment` is a constructor accessed via the `Abba` object. Its methods, like `getResults`, are called on instances created with `new`.","wrong":"import { Experiment } from 'abbajs';\nconst experiment = new Experiment(...);","symbol":"Abba.Experiment","correct":"const Abba = require('abbajs');\nconst experiment = new Abba.Experiment(numVariations, baselineNumSuccesses, baselineNumTrials, intervalAlpha);"}],"quickstart":{"code":"const Abba = require('abbajs');\n\n// Create a normal distribution instance for analysis\nconst normal = new Abba.NormalDistribution(1, 2);\nconsole.log('Normal Density at 1:', normal.density(1));\nconsole.log('Normal CDF at 3:', normal.cdf(3));\n\n// Create a binomial distribution instance\nconst binomial = new Abba.BinomialDistribution(1000, 0.3);\nconsole.log('Binomial Mass at 300:', binomial.mass(300));\nconsole.log('Binomial CDF at 310:', binomial.cdf(310));\n\n// Computes an A/B test experiment result\nconst experiment = new Abba.Experiment(3, 20, 100, 0.05);\nconst result = experiment.getResults(50, 150);\nconsole.log('Experiment Result:', JSON.stringify(result, null, 2));\n/* Expected output structure:\n{\n  \"proportion\": {\n    \"value\": 0.3333333333333333,\n    \"lowerBound\": 0.24862657323794302,\n    \"upperBound\": 0.4303072595809455\n  },\n  \"relativeImprovement\": {\n    \"value\": 0.6666666666666665,\n    \"lowerBound\": -0.040933756155489553,\n    \"upperBound\": 1.1803459277365715\n  },\n  \"pValue\": 0.05749442762442982\n}*/","lang":"javascript","description":"Demonstrates the core functionality of Abba.js, including creating and using Normal and Binomial distribution objects, and computing A/B experiment results."},"warnings":[{"fix":"For Node.js ESM projects, dynamic `import()` might be used with caution, but is not officially supported. For browser ESM, a CJS-compatible bundler (like Webpack or Rollup) is required. In Node.js CJS, use `const Abba = require('abbajs');`.","message":"This package is explicitly designed for CommonJS (CJS) environments and does not support ES Modules (ESM) syntax natively. Attempting to `import` it directly in an ESM context will lead to `ERR_REQUIRE_ESM` or similar errors.","severity":"breaking","affected_versions":"0.1.0 - 0.1.4"},{"fix":"Evaluate alternatives for A/B testing analysis that are actively maintained and compatible with modern JavaScript ecosystems. If used, thoroughly audit the code for potential vulnerabilities or inaccuracies.","message":"The package is highly unmaintained, with its last commit over 7 years ago and current version 0.1.4 published in 2014. This means there are unlikely to be any updates, bug fixes, or security patches.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.4"},{"fix":"Replace `var` with `const` or `let` as appropriate in your consuming code, though this does not change the internal implementation of the library.","message":"The documentation uses `var` declarations, indicative of older JavaScript practices. While functional, it might not align with modern `const`/`let` usage patterns.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.4"}],"env_vars":null,"search_vec":"'0.1.4':80 '2014':83 '7':98 'a/b':2,16,68,111 'abandon':88 'abba.js':1,5 'activ':94 'addit':52 'age':123 'analysi':4,13 'appear':85 'baselin':73 'binomi':23,50 'calcul':59 'cdf':40,45 'class':57 'common':106 'comput':29,114 'core':101 'cumul':37 'current':77 'densiti':36 'depend':120 'design':10 'differenti':102 'direct':115 'distribut':24,38,51,108 'environ':132 'esm':130 'esm-first':129 'experi':30,56 'extern':119 'first':131 'function':19,39,42,109 'improv':62 'includ':18 'invers':44 'javascript':8,117,133 'librari':9 'lie':103 'mainten':95 'make':124 'method':34 'modern':128 'normal':21,48 'offer':54,105 'p':65 'p-valu':64 'packag':75 'proport':60 'provid':33 'publish':81 'relat':61 'relev':14 'result':31,113 'signific':91 'statist':12,107 'surviv':41 'test':3,17,69,112 'though':121 'unsuit':126 'updat':92 'util':27 'valu':66 'variat':70 'version':79 'without':118 'year':99","created_at":"2026-04-20T01:51:06.162159+00:00","updated_at":"2026-04-20T01:51:06.162159+00:00","problems":[{"fix":"Ensure your file is treated as CommonJS (e.g., `.js` in a `package.json` with `\"type\": \"commonjs\"` or without a `\"type\"` field, or directly running with `node --require esm-loader your-file.js`) or use a bundler for browser usage. If you must use ESM, consider dynamic `import('abbajs')` (though not officially supported by this library).","cause":"Attempting to use `require()` in an ES Module (ESM) file without proper configuration, or in a browser environment without a module loader.","error":"ReferenceError: require is not defined"},{"fix":"Always use the `new` keyword when creating instances of distribution or experiment classes, e.g., `const normal = new Abba.NormalDistribution(1, 2);`","cause":"Invoking `Abba.NormalDistribution` or `Abba.Experiment` as a regular function instead of a constructor with the `new` keyword.","error":"TypeError: Abba.NormalDistribution is not a constructor"},{"fix":"Verify that `require('abbajs')` successfully returns the `Abba` object and that `abbajs` is correctly installed. Ensure the module is loaded in a CommonJS context.","cause":"The `Abba` object was not correctly imported or is undefined, likely due to an incorrect `require()` path, a misspelling, or attempting to use it in an incompatible module system (ESM).","error":"TypeError: Cannot read properties of undefined (reading 'NormalDistribution')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/thii/abbajs","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/abbajs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}