Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 months 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T16:04:29.000Z (3 months ago)
- Last Synced: 2024-10-24T19:14:56.825Z (3 months ago)
- Topics: browser, gateway, http, ipfs, javascript, node, react-native, speedtest, typescript
- Language: TypeScript
- Homepage:
- Size: 1.76 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
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[![npm version](https://badge.fury.io/js/elex.svg)](https://badge.fury.io/js/elex) [![Build Status](https://travis-ci.com/nampdn/elex.svg?branch=master)](https://travis-ci.com/nampdn/elex)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnampdn%2Felex.svg?type=shield)](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
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnampdn%2Felex.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnampdn%2Felex?ref=badge_large)