1.0.1 • Published 2 years ago

lucky-winner v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

��# lucky-winner A JS module for picking K random names from an array of N names.

where 1<=K<=N

Install

npm i lucky-winner

Usage

const luckyWinner = require('lucky-winner');
// luckyWinner(names,K=1) names:array and K:integer
console.log(luckyWinner(['pavan','chikkanna','gowda'])) // returns one random name.
console.log(luckyWinner(['pavan','chikkanna','gowda'],2)) // returns two random names
console.log(luckyWinner(['pavan','chikkanna','gowda'],3)) // returns three random names
console.log(luckyWinner(1)) // throws error
1.0.1

2 years ago

1.0.0

2 years ago