A simple and customizable random number generator built with JavaScript. This tool allows you to generate random numbers within a specified range, suitable for games, simulations, or simple number generation tasks.
- Generate a random number between a min and max value.
- Lightweight and dependency-free.
- Can be used in the browser or Node.js.
- Easy to integrate and modify.
You can clone the repository or simply copy the script into your project.
git clone https://github.com/ajaykumar413/random-number-generator-js.git<script src="randomNumberGenerator.js"></script>
<script>
const result = getRandomNumber(1, 100);
console.log("Random Number:", result);
</script>const { getRandomNumber } = require('./randomNumberGenerator');
console.log(getRandomNumber(10, 50)); // e.g., 27Here’s a basic version of the function you might include:
function getRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}- Add support for floats.
- Generate multiple numbers at once.
- Add seed functionality (for deterministic results).
This project is licensed under the MIT License - see the LICENSE file for details.
Pull requests are welcome! For major changes, please open an issue first to discuss what you’d like to change.
Created by [Ajay Kumar] – feel free to reach out via [ajayakumar7001@gmail.com].
Let me know if you'd like a version tailored for TypeScript, a GUI version (e.g. with HTML/CSS), or deployment instructions.