H2Wellness Developer's Randomizer
The H2Wellness Developer's Randomizer is a small NodeJS utility module the publishes methods that provide often used data in a random manner.
Development of this project is supported by H2Wellness.com.
Installation
npm install h2randomizer
Usage
var randomizer = ;
Random First Name
var str = randomizer;
output Brock
Random Last Name
var str = randomizer;
output Acosto
Random City Object
Each city is based on real zip code information provided by the USPS.
var o = randomizer;
output {"postalcode":"63112","city":"Saint Louis","state":"MO","longitude":"38.63","latitude":"-90.24"}
Random Address One
var str = randomizer;
output 29 Monroe St.
Random Address Two
var str = randomizer;
output Mailstop 60
Random Gender
var str = randomizer;
output male
Random Email Domain
var str = randomizer;
output git.com
Random Password
var str = randomizer;
output 6c24b952-8c22-4c24-abc2-cbc0e5cc7a94
Random Boolean
var b = randomizer;
output false
Random Date
randomizer.getRandomDateSync(startDate, endDate)
var d = randomizer;
output Tue Mar 11 2014 00:25:26 GMT-0700 (PDT)
Random Callback URL
var str = randomizer;
output http://www.BirchSharron.com/services/
Random Phone Number
var str = randomizer;
output 8627224951
Random Description
The method take one parameter, numberOfWords
, which indicates the number of words to put in the description. If you leave the parameter null, the default is 10 words.
var str = randomizer;
output duncify undergaoler nawab thiosinamine
Get Random Number Between Min and Max, Inclusive
This method allows you get a randon number between a minimum and maximum value inclusively. The minimum value must be at least 1. The maximum value must be greater than the minimum value.
var ij;i = 2;j = 10;var num = randomizer;
output 9
An error
is thrown when the min
or max
value is missing, when the min
equals the max
value or when the max
value is less than the min
value.