randomner

Random lib for JavaScript

npm install randomner
10 downloads in the last week
21 downloads in the last month

Randomner

Randomner is an library for Node.JS which provide powerful function for using random values.

Installation

You can install Randomner-Js with the npm:

npm install randomner

Functions

randInt(min, max)

Generates random integer between min and max

Arguments

  • min - An minimal value of result.
  • max - An maximum value of result.

Example

// Generates random integer between 5 and 10
var randomner = require('randomner');
var randomInteger = randomner.randInt(5, 10);

randFloat(min, max)

Generates random float between min and max

Arguments

  • min - An minimal value of result.
  • max - An maximum value of result.

Example

// Generates random float between 2.10 and 3.14
var randomner = require('randomner');
var randomInteger = randomner.randInt(2.10, 3.14);

randString(min, max)

Generates random string with length between min and max

Arguments

  • min - An minimal length of result string.
  • max - An maximum length of result string.

Example

// Generates random string with length between 10 and 42
var randomner = require('randomner');
var randomInteger = randomner.randString(10, 42);

randHexColor()

Generates random HEX-code of color

Example

// Generates random HEX-code of color
var randomner = require('randomner');
var randomInteger = randomner.randHexColor();

randRgbColor()

Generates random json of rgb-color

Example

// Generates random json of rgb-color
var randomner = require('randomner');
var randomInteger = randomner.randRgbColor();

randTld()

// Generates random Top-level domain zone

Example

// Generates random Top-level domain zone
var randomner = require('randomner');
var randomInteger = randomner.randTld();

randDomain({min, max})

Generates random Top-level domain

Arguments

  • min - An minimal length name of domain.
  • max - An maximum length name of domain.

Example

// Generates random Top-level domain
var randomner = require('randomner');
var randomInteger = randomner.randDomain({min: 5, max: 14});

randEmail({min, max})

Generates random email

Arguments

  • min - An minimal length name of user and domain.
  • max - An maximum length name of user and domain.

Example

// Generates random email
var randomner = require('randomner');
var randomInteger = randomner.randEmail({min: 5, max: 14});

randIpv4Ip()

Generates random IPv4 address

Example

// Generates random IPv4 address
var randomner = require('randomner');
var randomInteger = randomner.randIpv4Ip();

randTimeAmPm()

Return pm or am

Example

// Return pm or am
var randomner = require('randomner');
var randomInteger = randomner.randTimeAmPm();

randMonth()

Generates random month

Example

// Generates random month
var randomner = require('randomner');
var randomInteger = randomner.randMonth();

randTimeStamp()

Generates random timestamp

Example

// Generates random timestamp
var randomner = require('randomner');
var randomInteger = randomner.randTimeStamp();

randDateTime()

Generates JavaScript object Date with random DateTime

Example

// Generates JavaScript object Date with random DateTime
var randomner = require('randomner');
var randomInteger = randomner.randDateTime();

randCoordinates()

Generates random coordinates

Example

// Generates random coordinates
var randomner = require('randomner');
var randomInteger = randomner.randCoordinates();

randCountry()

Generates random country

Example

// Generates random country
var randomner = require('randomner');
var randomInteger = randomner.randCountry();
npm loves you