1.0.2 • Published 3 years ago

create-random-key v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

create-random-key

NPM INSTALL NODE JS

📌 Installation

npm i create-random-key 

🔰 Usage

const createRandomKey = require('create-random-key');

// With max value
const key = createRandomKey({ max: 100 });
// return -> 96 / 37 / 80 / 0

// Without max value (default value 10)
const key = createRandomKey();
// return -> 10 / 3 / 0 / 7



// Example:

function giveawayWinner(){
    const key = createRandomKey({ max: 4 });
    const winner = ['justin', 'kendrick', 'webster', 'travis', 'don'];
    return winner[key]
}

const theWinner = giveawayWinner();
// E.g result => 'webster' 

👥 Social

✨ Support

Author @gnwncpta

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago