Perform election speed check on list of gateways to find the fastest url
yarn add elex
import {electSome} from 'elex'
(async () => {
const urlsToCheck = ['https://google.com', 'https://bing.com', 'https://vgm.tv', 'https://not-found-404.com']
const someFastUrls = await electSome(urlsToCheck, {count: 2, retries: 1}); // ['http://google.com', 'https://vgm.tv']
})()
import {electAny} from 'elex'
(async () => {
const urlsToCheck = ['https://google.com', 'https://bing.com', 'https://vgm.tv', 'https://not-found-404.com']
const mostFastUrls = await electAny(urlsToCheck, {prefer: 'https://vgm.tv', retries: 1}); // 'https://vgm.tv'
})()