Generate random number in a range
number-random is available as an npm package.
npm i number-random
const random = require('number-random');
random(0,1); // 0 or 1
random(1); // 0 or 1
random(100); // 0~100
random(100,999); // 100~999
random(100,999,true); //663.7264946557116
random(100,999,4); //346.5673
random(0,1,true); //0.1557056098245
random(); //0.3497616536915302
This project is licensed under the terms of the MIT license