random-everything
v1.2.0
Published
A versatile npm package for generating random data of various types.
Downloads
15
Maintainers
Readme
Random Everything - The Ultimate Random Data Generator
Random Everything is a powerful and versatile npm package that allows you to generate random data of various types, making it an essential tool for developers, testers, and anyone in need of random values. From numbers to complex data structures, this package has it all.
Installation
npm install random-everything
Usage/Example
const randomGen = require('random-everything');
randomGen.number(min, max)
Description: Generates a random integer between min
and max
.
const randomNum = randomGen.number(1, 100);
randomGen.alphanumeric(length)
Description: Generates a random alphanumeric string of a specified length.
const randomString = randomGen.alphanumeric(10);
randomGen.decimal(min, max, decimals)
Description: Generates a random decimal number between min
and max
with a specified number of decimal places.
const randomDec = randomGen.decimal(1.5, 5.5, 2);
randomGen.date(format)
Description: Generates a random date in the specified format (DD/MM/YYYY
, MM-DD-YY
, etc.). The format is case-insensitive.
const randomDate = randomGen.date('DD-MM-YYYY');
randomGen.time()
Description: Generates a random time in the format HH:MM:SS
.
const randomTime = randomGen.time();
randomGen.boolean()
Description: Generates a random boolean value (true
or false
).
const randomBool = randomGen.boolean();
randomGen.arrayElement(array)
Description: Returns a random element from the provided array.
const randomElem = randomGen.arrayElement(['apple', 'banana', 'cherry']);
randomGen.string(length)
Description: Generates a random string of alphabets only (no numbers).
const randomStr = randomGen.string(8);
randomGen.hexString(length)
Description: Generates a random hexadecimal string of the specified length.
const randomHex = randomGen.hexString(6);
randomGen.uuid()
Description: Generates a random UUID (version 4).
const randomUUID = randomGen.uuid();
randomGen.ipAddress()
Description: Generates a random IPv4 address.
const randomIP = randomGen.ipAddress();
randomGen.rgbColor()
Description: Generates a random RGB color value.
const randomColor = randomGen.rgbColor();
randomGen.password(length)
Description: Generates a random secure password of the specified length.
const randomPwd = randomGen.password(12);
randomGen.dnaSequence(length)
Description: Generates a random DNA sequence composed of A, T, C, G.
const randomDNA = randomGen.dnaSequence(50);
randomGen.mathExpression(terms)
Description: Generates a random mathematical expression with a specified number of terms.
const randomExpression = randomGen.mathExpression(3);
randomGen.emojiArt(width, height)
Description: Generates a random emoji art with specified width and height.
const randomArt = randomGen.emojiArt(5, 5);
randomGen.musicNoteSequence(length)
Description: Generates a random sequence of music notes.
const randomNotes = randomGen.musicNoteSequence(8);
randomGen.mandelbrotCoordinate()
Description: Generates random coordinates within the Mandelbrot set.
const randomCoord = randomGen.mandelbrotCoordinate();
randomGen.fantasyCreatureName()
Description: Generates a random fantasy creature name.
const randomCreature = randomGen.fantasyCreatureName();
randomGen.haiku()
Description: Generates a random haiku following the 5-7-5 syllable structure.
const randomHaiku = randomGen.haiku();
randomGen.constellationName()
Description: Generates a random constellation name.
const randomConstellation = randomGen.constellationName();
randomGen.secretCode()
Description: Generates a random secret code, suitable for espionage scenarios.
const randomCode = randomGen.secretCode();
randomGen.quantumState()
Description: Generates a random quantum state (simplified).
const randomQubit = randomGen.quantumState();
randomGen.paradox()
Description: Generates a random paradoxical statement.
const randomParadox = randomGen.paradox();
randomGen.infiniteLoop(language)
Description: Generates a humorous infinite loop example in a specified programming language.
const randomLoop = randomGen.infiniteLoop('JavaScript');
randomGen.alienPhrase()
Description: Generates a random phrase in a made-up alien language.
const randomAlien = randomGen.alienPhrase();
randomGen.artifactName()
Description: Generates a random name for a mythical artifact.
const randomArtifact = randomGen.artifactName();
randomGen.hypercubeCoordinate()
Description: Generates random coordinates in a 4D hypercube.
const randomHyperCube = randomGen.hypercubeCoordinate();