@sweatshop/dsteem-fallback

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i @sweatshop/dsteem-fallback

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

8.51 kB

Total Files

6

Last publish

Collaborators

  • pauliusuza