UNPKG

vuagen

Version:

Vuagen is a simple and flexible User-Agent generator for browser automation, testing, and web scraping.

11 lines (9 loc) 289 B
function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } function getRandomItem(array) { return array[getRandomInt(0, array.length - 1)]; } module.exports = { getRandomInt, getRandomItem };