tumbojs

1.3.0 • Public • Published

tumbo.js

Randomly select elements from an array efficiently.

Build Status Coverage Status

Tumbo.js is an npm package to randomly select a desired number of elements from an array.

Getting started.

Install this package from npm by running the command npm install tumbojs

API

var tumbo = require('tumbojs')

tumbo.pick(array, n)

The pick method takes in an array and a number specifying the number of elements that should be selected randomly to form the new array.

//EXAMPLE
const tumbo = require('tumbojs');
const myarr = ["Hello", "Hi", "Hey"];
const newarr = tumbo.pick(myarr, 2);
 

Tests

Run npm test to run tests

Author

George Benjamin

License

ISC

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    1
  • 1.2.0
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i tumbojs

Weekly Downloads

1

Version

1.3.0

License

ISC

Unpacked Size

1.04 MB

Total Files

34

Last publish

Collaborators

  • georgeben