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 🙏

© 2026 – Pkg Stats / Ryan Hefner

protean-test

v0.0.2-alpha

Published

Radically simple zscore based AB testing

Readme

protean.js

[This version is just barely held together, look for something more complete in the next few days]

A wrapper for administering and measuring AB tests at any place in the stack using zscore probability. Rather than trying to be a one stop solution for both content and grouping and measurement, it just handles the binning of a user into a test group and the transformation of the incoming id into the tested id (ids could be routes, file paths, or any other simple value).

A word of caution: You must show both patience and restraint when testing and acknowledge outside factors, such as publicity, traffic, slanted demographics due to a mometary marketing campaign, etc. It's very easy to fool yourself once the graphs feel like they're moving towards a conclusion.

Creating Tests:

Simple Usage:

Strategies for Use:

  1. Route Testing

Sometimes you want your tests to be simple routes substitutions which allow the view to be swapped wholesale with another, in a controller oriented framework this means triggering a different controller. Whereas in a View oriented framework, the render implies the controller, so you start from the view. Either way, it works like a charm.

Controller Oriented:

//we assume a 'user' object and a clean 'path' variable and a 'controller_root'
Protean.passthru(path, user, function(testedPath){
    //this file becomes the resolved controller for the test
    eval(controller_root+path+'.js');
    // or you could isolate the controllers by using vm.runInNewContext()
});

View Oriented:

//we assume a 'user', 'data' and 'response' object, a clean 'path' variable and a 'Renderer' object
Protean.passthru(path, user, function(testedPath){
    Renderer.render(testedPath, data, function(renderedText){
        response.end(renderedText);
    });
});
  1. Template Testing

Often views are broken down into templates, which are rendered and aggregated from within some monolithic controller. You can invert this relationship by linking controller execution to the view by adding a macro to your template language to render a subpanel, and conditionally include the controller for data loading.

[insert handlebars example]

  1. Database Testing You could also store variants in a DB, so that the DB configuration becomes the control point, rather than the controller or the view. In order to use the DB as your test control point.

[mysql example]

[mongo example]

Really, you can do anything, this is just a sample of some common strategies.

Test Data Storage

By default, Protean stores all test assignment and results in SQLite. Sometimes you want your own control of the storage engine. To do this you need to override a few functions... I'm going to show an example in MySQL, but it works the same with any datastore.

Analytics

[todo]

Testing

Run the test harness at the project root with:

mocha

Enjoy,

-Abbey Hawk Sparrow