1.0.1 • Published 2 years ago

sample-size v1.0.1

Weekly downloads
2,703
License
UNLICENSE
Repository
github
Last release
2 years ago

sample-size npm.io npm.io

🎲 random pass/fail by sample size

Accepts one decimal fraction

const sample = require('sample-size');

filter(0) // always false

filter(1) // always true

filter(.2) // about 20% true

Usage examples

Report only about 5% of events

sample(.05) && reportEvent();

Sample about half of a list

array.filter(() => sample(.5));
1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.0

5 years ago