1.3.4 • Published 5 years ago
randisc v1.3.4
API
const randisc = require('randisc')
random
randisc.random() // a floating point Ex: 0.031282989400911454
range
randisc.range(1, 50) // an integer between 1 and 50 Ex: 41
float
randisc.float(1, 50, 3) // a decimal between 1 and 50 with 3 digits (default:18) Ex: 21.637
id
randisc.id('alphabet', 6) // an alphabet based id (also:digit or alphadigit) with 6 chars (default:18) Ex: 4h7J8v
choice
randisc.choice(['Apple', 'Papaya', 'Mango']) // a randomly selected item Ex: Papaya
choices
randisc.choices([1, 2, 3], 5) // a list with 5 randomly selected items (default:8) Ex: [2, 3, 1, 2, 3]
boolean
randisc.boolean() // true or false
shuffle
randisc.shuffle([1, 2, 3]) // a newly indexed list Ex: [3, 1, 2]
Hello Internet, I am Ethan. This is my very first package, I hope you find it useful. Also please post your ideas and suggestions at ethanlal04@gmail.com. I'll be seeing you soon. Take care :)