Registry / data / abbajs

abbajs

JSON →
library0.1.4jsnpmunverified

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.

npm install abbajs
INSTALL
IMPORT
SIG · ABBAJS
A
abbajs
datajavascriptv0.1.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Abba
const Abba = require('abbajs');
import Abba from 'abbajs'; import { Abba } from 'abbajs';
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.
Abba.NormalDistribution
const Abba = require('abbajs'); const normal = new Abba.NormalDistribution(mean, standardDeviation);
import { NormalDistribution } from 'abbajs'; const normal = new NormalDistribution(mean, standardDeviation);
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.
Abba.Experiment
const Abba = require('abbajs'); const experiment = new Abba.Experiment(numVariations, baselineNumSuccesses, baselineNumTrials, intervalAlpha);
import { Experiment } from 'abbajs'; const experiment = new Experiment(...);
Similar to `NormalDistribution`, `Experiment` is a constructor accessed via the `Abba` object. Its methods, like `getResults`, are called on instances created with `new`.

Demonstrates the core functionality of Abba.js, including creating and using Normal and Binomial distribution objects, and computing A/B experiment results.

const Abba = require('abbajs'); // Create a normal distribution instance for analysis const normal = new Abba.NormalDistribution(1, 2); console.log('Normal Density at 1:', normal.density(1)); console.log('Normal CDF at 3:', normal.cdf(3)); // Create a binomial distribution instance const binomial = new Abba.BinomialDistribution(1000, 0.3); console.log('Binomial Mass at 300:', binomial.mass(300)); console.log('Binomial CDF at 310:', binomial.cdf(310)); // Computes an A/B test experiment result const experiment = new Abba.Experiment(3, 20, 100, 0.05); const result = experiment.getResults(50, 150); console.log('Experiment Result:', JSON.stringify(result, null, 2)); /* Expected output structure: { "proportion": { "value": 0.3333333333333333, "lowerBound": 0.24862657323794302, "upperBound": 0.4303072595809455 }, "relativeImprovement": { "value": 0.6666666666666665, "lowerBound": -0.040933756155489553, "upperBound": 1.1803459277365715 }, "pValue": 0.05749442762442982 }*/
Debug
Known issues
breakingThis 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.
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');`.
affects: 0.1.0 - 0.1.4
gotchaThe 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.
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.
affects: 0.1.0 - 0.1.4
gotchaThe documentation uses `var` declarations, indicative of older JavaScript practices. While functional, it might not align with modern `const`/`let` usage patterns.
fix
Replace `var` with `const` or `let` as appropriate in your consuming code, though this does not change the internal implementation of the library.
affects: 0.1.0 - 0.1.4
Errors
Common errors & fixes
ReferenceError: require is not defined
Attempting to use `require()` in an ES Module (ESM) file without proper configuration, or in a browser environment without a module loader.
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).
TypeError: Abba.NormalDistribution is not a constructor
Invoking `Abba.NormalDistribution` or `Abba.Experiment` as a regular function instead of a constructor with the `new` keyword.
fix
Always use the `new` keyword when creating instances of distribution or experiment classes, e.g., `const normal = new Abba.NormalDistribution(1, 2);`
TypeError: Cannot read properties of undefined (reading 'NormalDistribution')
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).
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.
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
56 hits · last 30 days
node
48
OpenAI (training)
1
Resources
abbajs — npm install abbajs · libregistry