1.0.1 • Published 5 years ago
randomres v1.0.1
Randomres
Randomres is a simple module to make it easy for you to get values from several data types randomly
Install
npm install randomres
yarn add randomres
How to Use
// string method
const randomres = require('randomres')
// default value
randomres.str() //-> pt6K5g4x0G
randomres.str({
collect: 'alphabet',
length: 15
})
randomres.str({
collect: 'uppercase',
length: 22
})
// date method
const randomres = require('randomres')
// default value
randomres.date() //-> 2022-01-25T03:18:43.241Z
randomres.date({
start: 2025,
end: 2032
})
// compile method
const randomres = require('randomres')
const fruits = ['banana', 'apple', 'avocado']
randomres.compile({
set: fruits
})
const description = 'Get random value with RandomRes'
randomres.compile({
set: description,
length: 100
})
Date Method
The start
and end
keys of the date method have default values. The default start
value is the current date, for the default end
value is one year ahead.
Compile Method
In the compile
method, the input data types are strings and arrays.
. . .
License
This module is released under the MIT License