Ninja Pumpkin Mutants

    rand-paul

    2.1.2 • Public • Published

    Rand Paul

    Get a random value from an array.

    Usage

    npm install rand-paul --save
    var rand = require('rand-paul');
     
    var candidates = [
      'Ted Cruz',
      'Ben Carson',
      'Jeb Bush',
      'Mike Huckabee',
      'Rand Paul',
      'Donald Trump'
    ]
     
    var president = rand.paul(candidates);
    console.log(president) // => 'Rand Paul'

    You can grab the index of the item by specifying it in the options object.

    var president = rand.paul(candidates, {includeIndex: true});
     
    console.log(president) // => { item: 'Rand Paul', includeIndex: 4 }

    Contribution

    Fork and do your thing. If your code is as messy and/or unkempt as Rand's hair I will not accept.

    LICENSE

    WTFPL (...)

    Install

    npm i rand-paul

    DownloadsWeekly Downloads

    3

    Version

    2.1.2

    License

    MIT

    Last publish

    Collaborators

    • probablyjosh