@lucadv/pickme

A library to randomly pick up an element from a list passed by the user

Stats

StarsIssuesVersionUpdatedCreatedSize
@lucadv/pickme
001.1.03 years ago3 years agoMinified + gzip package size for @lucadv/pickme in KB

Readme

Overview

A module that, given a list of elements, randomly pick up one and return it. The list must contain elements of type number, string or boolean. It can contain duplicated elements and elements of different types.

Usage

const Pickme = require('@lucadv/pickme');
const picked = new Pickme(['a', 'b', 'c']).pickOne(); // will be one of a, b or c

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.