0.1.7 • Published 10 months ago

lib-random-array v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Lib-Random-Array

A JavaScript library for generating arrays with various data types. Easily create arrays containing random numbers, strings, boolean values, and objects. Suitable for testing, populating, and creating examples.

Installation

npm i lib-random-array

Example

import { UseRandomArray } from "lib-random-array";

const random = new UseRandomArray();

Array of numbers

console.log(random.number());

Array of strings

console.log(random.string());

Array of boolean

console.log(random.boolean());

Parameters

Method number()

  • length - array length. Default is 10

  • min - minimum value. Default is 0

  • max - maximum value. Default is 10

  • unique - the uniqueness of numeric values. Default is TRUE

console.log(random.number(20, 0, 100, true));

Method string()

  • length - array length. Default is 10

  • character - length of each string. Default is 10

console.log(random.string(20, 30));

Method boolean()

  • length - array length. Default is 10
console.log(random.boolean(20));
0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago