UNPKG

oddsportal

Version:

oddsportal scrape for www.keydobot.com

24 lines (17 loc) 512 B
const asyncForEach = async (array, callback) => { for (let index = 0; index < array.length; index++) { await callback(array[index], index, array); } }; const waitFor = (ms = 60000) => new Promise((r) => setTimeout(r, ms)); const waitPageClose = (browser) => new Promise((r) => { setInterval(() => { if(Number(browser._connection._sessions.size) + 1 <= process.env.MAX_PAGE)r(); }, 100); }); module.exports = { asyncForEach, waitFor, waitPageClose };