1.0.1 • Published 6 years ago

@sweatshop/dsteem-fallback v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

dsteem-fallback Package Version

Thin wrapper around dsteem with identical API and automated fallback support

Installation

npm i @sweatshop/dsteem-fallback --save

Usage

original dsteem constructor:

  import dsteem from 'dsteem';
  const client = new dsteem.Client('https://api.steemit.com');

dsteem-fallback constructor:

  import dsteem from '@sweatshop/dsteem-fallback';
  const client = new dsteem.Client([
    'https://api.badunresponsivedomain.com', //this will fail within 5 seconds as defined by timeout property
    'https://api.steemit.com'
  ], {
    timeout: 5 * 1000 // optional, defaults to 60s
  });

Support

This project is brought to you by @upheaver.

License

MIT