@prakharadgale/randomize-js
v1.0.5
Published
![npm](https://img.shields.io/npm/v/@prakharadgale/randomize-js) ![license](https://img.shields.io/badge/license-MIT-blue.svg)
Downloads
13
Readme
Randomize
Description
A simple npm package for generating random numbers. This package allows you to easily create random numbers of specified lengths, making it useful for various applications such as generating unique IDs, random passwords, or simply for testing purposes.
Table of Contents
Installation
To install the package, run:
npm install @prakharadgale/randomize-js
Usage
const random = new Randomize();
const randomNum = random.number({ length: 4 });
console.log(randomNum); // E.g., "2743"
API
Randomize
The main class for generating random numbers.
number(options)
Description: Generates a random number based on the specified options.
Parameters:
options
(object): An object to specify options for generating the random number.length
(number): The desired length of the generated number.
Returns: A random number as a string.