h2randomizer

1.0.7 • Public • Published

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 = require("h2randomizer");

Random First Name

var str = randomizer.getRandomFirstNameSync();

output Brock


Random Last Name

var str = randomizer.getRandomLastNameSync();

output Acosto


Random City Object

Each city is based on real zip code information provided by the USPS.

var o = randomizer.getRandomCitySync();

output {"postalcode":"63112","city":"Saint Louis","state":"MO","longitude":"38.63","latitude":"-90.24"}


Random Address One

var str = randomizer.getRandomAddressOneSync();

output 29 Monroe St.


Random Address Two

var str = randomizer.getRandomAddressTwoSync();

output Mailstop 60


Random Gender

var str = randomizer.getRandomGenderSync();

output male


Random Email Domain

var str = randomizer.getRandomEmailDomainSync();

output git.com


Random Password

var str = randomizer.getRandomPasswordSync();

output 6c24b952-8c22-4c24-abc2-cbc0e5cc7a94


Random Boolean

var b = randomizer.getRandomBooleanSync();

output false


Random Date

randomizer.getRandomDateSync(startDate, endDate)

var d = randomizer.getRandomDateSync(new Date("11/12/1998"),new Date());

output Tue Mar 11 2014 00:25:26 GMT-0700 (PDT)


Random Callback URL

var str = randomizer.getRandomCallbackUrlSync();

output http://www.BirchSharron.com/services/


Random Phone Number

var str = randomizer.getRandomPhoneNumberUsaSync();

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.getRandomDescriptionSync(4);

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 i,j;
= 2;
= 10;
var num = randomizer.getRandomIntInclusiveSync(i, j);

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.

Readme

Keywords

Package Sidebar

Install

npm i h2randomizer

Weekly Downloads

0

Version

1.0.7

License

MIT

Last publish

Collaborators

  • h2reselbob
  • h2wellness