randomise-gen
v1.0.0
Published
Generate random responces quickly.
Downloads
3
Readme
randomise-gen
A node package used for generating random responses
Installation
npm i randomise-gen
Usage
const random = require("randomise-gen");
const array = ["apple", 1, true]
//Generates a random choice from the array.
random.array(array).then(result => {
console.log(result)
//Returns a random item from the array.
})
//Generates a random string of uppercase, lowercase letters and numbers.
random.characters(length).then(result => {
console.log(result)
//Returns a random string consiting of uppercase, lowercase letters and numbers.
})
//Generates a random numer between 0 and the given number
random.int(length).then(result => {
console.log(result)
//Returns a random number between 0 and the given number.
})
//Generates a random string of numbers.
random.number(lenth).then(result => {
console.log(result)
//Returns a random string consiting of numbers.
})
//Generates a random string of uppercase letters.
random.letterUpper(length).then(result => {
console.log(result)
//Returns a random string consiting of uppercase letters.
})
//Generates a random string of lowercase letters.
random.letterLower(length).then(result => {
console.log(result)
//Returns a random string consiting of lowercase letters.
})
//Generates a random string of uppercase and lowercase letters.
random.letter(length).then(result => {
console.log(result)
//Returns a random string consiting of uppercase and lowercase letters.
})
//Generates a random Javascript Boolean expression.
random.boolean().then(result => {
console.log(result)
//Returns either True of False.
})