randomise-gen
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.
})

Readme

Keywords

Package Sidebar

Install

npm i randomise-gen

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

7.03 kB

Total Files

5

Last publish

Collaborators

  • siraaa