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

minimum-sample-set

v1.3.2

Published

sample a large data set into a much smaller one by keeping only those that offer something new

Downloads

21

Readme

minimum-sample-set

Sample a large data set into a much smaller one by keeping only those data points that have something not seen before in previous samples.

What's it for?

This module implements the logic of something known as "pair-wise testing"

  • where instead of testing every combination of possible values, you only test each distinct combination of two values. This greatly reduces the number of test cases that you test.

This module offers customization of this logic, including being able to select which fields are taken into consideration, to ignore certain pairs, or to track every combination of values of certain fields.

But why?

This module is for use in an application used by software developers and test professionals to wrangle the number of test cases in situations where the number of combinations makes it impossible to test them all, not even automated.

It is meant to be used as part of a "test matrix calculator" which allows the user to specify the parameters and their possible values, and the application outputs a minimum set of test cases to test.

Installation

npm install --save minimum-sample-set

Usage

Create the object that does the sampling:

let mss = new MinimumSampleSet();

Tell it which fields in the data are important to you:

// either one at a time:
mss.consider('foo').consider('bar');

// or all at once
mss.considerAll( ['foo','bar'] );

You can also add fields in bulk and then remove the ones that do not apply here

let fields = ['A','B','C','D','E'];
...
mss.considerAll( fields ).ignore( 'C' );

You can also tell it to ignore select field pairings, which means that typically fewer samples will be selected for inclusion in the output.

mss.ignorePair('A','B').ignorePair('B','C');

Or you can give it groups of fields to consider ALL combinations of:

mss.considerGroup(['A','C','E']);

Next, push all your data samples into it:

sample_data.forEach( record => mss.sample( record ) );

Finally, get the selected records out

let selected_data = mss.selected();

If you need to re-use the MinimumSampleSet object, you can reset it between data sets:

mss.reset();

Caution - Memory Intensive

This algorithm works by keeping a hash of unique field/value combinations, and groups of fields and their values, and pointing each at the record that produced it. It is intended to operate only on fields that have limited sample values, like enums. If you throw unique values at the algorithm, it will select every single record, and use up a lot of memory in the process.