Neeraj

Random

This Random package is a simple and flexible utility for generating random values in JavaScript and TypeScript. You can generate numeric, string and boolean values with full control over the generation using parameters.

Usage

import {
  randomBoolean,
  randomBooleanArray,
  randomUUID,
  randomUUIDArray,
} from "@n-eeraj/random"

Exported Functions

randomBoolean() Generates a random boolean value.

Example Usage:

randomBoolean()
// Returns a random boolean

randomBooleanArray(length) Generates an of random boolean values.

Example Usage:

randomBooleanArray(5)
// Returns an array of 5 random booleans

randomUUID() Generates a random UUID using crypto.randomUUID().

Example Usage:

randomUUID()
// Returns a random UUID

randomUUIDArray(length) Generates an of random UUID using crypto.randomUUID().

Example Usage:

randomUUIDArray(5)
// Returns an array of 5 random UUIDs

Read more about crypto.randomUUID().

Install
npm install @n-eeraj/random
@n-eeraj/randomN-eeraj/random

  • 1 Stars
  • 0 Forks
  • 0 Open Issues


Keywords
  • random
  • random js
  • random generator
  • shuffle

Languages
  • TypeScript98.9%
  • Shell1.1%
  • Version:1.2.123
  • Last Publish:2 months ago
  • Weekly Downloads:15