https://github.com/nampdn/elex
Perform election speed check on list of gateways to find the fastest url
https://github.com/nampdn/elex
browser gateway http ipfs javascript node react-native speedtest typescript
Last synced: 13 days ago
JSON representation
Perform election speed check on list of gateways to find the fastest url
- Host: GitHub
- URL: https://github.com/nampdn/elex
- Owner: nampdn
- License: mit
- Created: 2018-12-14T04:04:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-06-18T22:37:10.000Z (27 days ago)
- Last Synced: 2025-06-18T23:28:08.793Z (27 days ago)
- Topics: browser, gateway, http, ipfs, javascript, node, react-native, speedtest, typescript
- Language: TypeScript
- Homepage:
- Size: 1.57 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# elex
Perform election speed check on list of gateways to find the fastest url[](https://badge.fury.io/js/elex) [](https://travis-ci.com/nampdn/elex)
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fnampdn%2Felex?ref=badge_shield)
## Installation```bash
yarn add elex
```## Usage
### Elect some (some most fastest):
```javascript
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']
})()
```### Elect any (the fastest one):
```javascript
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'
})()
```## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fnampdn%2Felex?ref=badge_large)